diff --git a/include/class.format.php b/include/class.format.php
index d4d2353..8385893 100644
--- a/include/class.format.php
+++ b/include/class.format.php
@@ -62,7 +62,9 @@ class Format {
}
function htmlchars($var) {
- return is_array($var)?array_map(array('Format','htmlchars'),$var):htmlspecialchars($var,ENT_QUOTES);
+ //added with inspiration from http://osticket.com/forums/showthread.php?t=6678&highlight=utf8
+ return is_array($var)?array_map(array('Format','htmlchars'),$var): utf8_decode(htmlspecialchars($var,ENT_QUOTES));
+ //return is_array($var)?array_map(array('Format','htmlchars'),$var):htmlspecialchars($var,ENT_QUOTES);
}
diff --git a/include/class.ticket.php b/include/class.ticket.php
index 89c2f79..52a6d87 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -608,7 +608,8 @@ class Ticket{
',headers='.db_input($headers). //Raw header.
',source='.db_input($source).
',ip_address='.db_input($_SERVER['REMOTE_ADDR']);
-
+ //added with inspiration from http://osticket.com/forums/showthread.php?t=6678&highlight=utf8
+ $sql = utf8_decode($sql);
if(db_query($sql) && ($msgid=db_insert_id())) {
$this->setLastMsgId($msgid);
$this->onMessage();
diff --git a/include/client/viewticket.inc.php b/include/client/viewticket.inc.php
index 3dd4c80..cda6c7d 100644
--- a/include/client/viewticket.inc.php
+++ b/include/client/viewticket.inc.php
@@ -75,7 +75,7 @@ $dept=($dept && $dept->isPublic())?$dept:$cfg->getDefaultDept();
}?>
- =Format::display($msg_row['message'])?> |
+ =utf8_encode(Format::display($msg_row['message']))?> |
//get answers for messages
@@ -98,7 +98,7 @@ $dept=($dept && $dept->isPublic())?$dept:$cfg->getDefaultDept();
}?>
- =Format::display($resp_row['response'])?> |
+ =utf8_encode(Format::display($resp_row['response']))?> |
} //endwhile...response loop.
diff --git a/include/mysql.php b/include/mysql.php
index e6295ee..8919a08 100644
--- a/include/mysql.php
+++ b/include/mysql.php
@@ -51,7 +51,9 @@
// execute sql query
function db_query($query, $database="",$conn=""){
global $cfg;
-
+ //added with inspiration from http://osticket.com/forums/showthread.php?t=6678&highlight=utf8
+ $query=utf8_encode($query);
+
if($conn){ /* connection is provided*/
$response=($database)?mysql_db_query($database,$query,$conn):mysql_query($query,$conn);
}else{
diff --git a/include/staff/viewticket.inc.php b/include/staff/viewticket.inc.php
index 792b44f..cff4fe9 100644
--- a/include/staff/viewticket.inc.php
+++ b/include/staff/viewticket.inc.php
@@ -61,7 +61,7 @@ if($ticket->isOverdue())
Name: |
- =Format::htmlchars($ticket->getName())?> |
+ =utf8_encode(Format::htmlchars($ticket->getName()))?> |
Email: |
@@ -85,13 +85,13 @@ if($ticket->isOverdue())
- Subject: =Format::htmlchars($ticket->getSubject())?> |
+ Subject: =utf8_encode(Format::htmlchars($ticket->getSubject()))?> |
Assigned Staff: |
- =$staff?Format::htmlchars($staff->getName()):'- unassigned -'?> |
+ =$staff?utf8_encode(Format::htmlchars($staff->getName())):'- unassigned -'?> |
Last Response: |
@@ -119,7 +119,7 @@ if($ticket->isOverdue())
Help Topic: |
$ht=$ticket->getHelpTopic();
- echo Format::htmlchars($ht?$ht:'N/A');
+echo utf8_encode(Format::htmlchars($ht?$ht:'N/A'));
?>
|
@@ -216,9 +216,9 @@ if(($resp=db_query($sql)) && ($notes=db_num_rows($resp))){
=Format::db_daydatetime($row['created'])?> - posted by =$row['source']?> |
if($row['title']) {?>
-
+
} ?>
- =Format::display($row['note'])?> |
+ =utf8_encode(Format::display($row['note']))?> |
} ?>
@@ -241,7 +241,7 @@ if(($resp=db_query($sql)) && ($notes=db_num_rows($resp))){
0){ ?>
}?>
- =Format::display($msg_row['message'])?> |
+ =utf8_encode(Format::display($msg_row['message']))?> |
//get answers for messages
@@ -259,7 +259,7 @@ if(($resp=db_query($sql)) && ($notes=db_num_rows($resp))){
|
}?>
- =Format::display($resp_row['response'])?> |
+ =utf8_encode(Format::display($resp_row['response']))?> |
}
$msgid =$msg_row['msg_id'];
@@ -298,7 +298,7 @@ if(($resp=db_query($sql)) && ($notes=db_num_rows($resp))){
onChange="getCannedResponse(this.options[this.selectedIndex].value,this.form,'response');this.selectedIndex='0';" >
-
+
}?>
}?>