Skip to content

Commit c9fb2dd

Browse files
committed
Bug Fix
Corrected (at least partially) a bug that prevented the HTML <script> tag from being parsed properly.
1 parent 39fade4 commit c9fb2dd

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

chatbot/core/aiml/parse_aiml_as_XML.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,12 @@ function parse_person2_tag($convoArr, $element, $parentName, $level)
565565
function parse_html_tag($convoArr, $element, $parentName, $level)
566566
{
567567
runDebug(__FILE__, __FUNCTION__, __LINE__, 'Parsing a generic HTML tag.', 2);
568-
return (string) $element->asXML();
568+
$response_string = $element->asXML();
569+
$response_string = str_replace('<text>', '', $response_string);
570+
$response_string = str_replace('</text>', '', $response_string);
571+
$star = $convoArr['star'][1];
572+
$response_string = str_replace('<star/>', $star, $response_string);
573+
return $response_string;
569574
}
570575

571576
function parse_gender_tag($convoArr, $element, $parentName, $level)

gui/jquery/index.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
$convo_id = (isset($_COOKIE[$cookie_name])) ? $_COOKIE[$cookie_name] : get_convo_id();
1313
$bot_id = (isset($_COOKIE['bot_id'])) ? $_COOKIE['bot_id'] : 1;
1414
setcookie('bot_id', $bot_id);
15+
$display = '';
16+
$url = 'http://localhost/Program-O/Program-O/chatbot/conversation_start.php';
1517
$display = 'Make sure that you edit this file to change the value of $url below to reflect the correct address, and to remove this message.' . PHP_EOL;
1618
$url = 'http://www.example.com/programo/chatbot/conversation_start.php';
1719

0 commit comments

Comments
 (0)