diff --git a/admin/communication.php b/admin/communication.php index 400d295..5473b00 100644 --- a/admin/communication.php +++ b/admin/communication.php @@ -728,12 +728,13 @@ case "email_get_list": echo ""; echo ""; echo "Date:".date("r").""; - echo "Subject:".htmlspecialchars(iconv("utf-8","ISO-8859-1",$r->subject)).""; + echo "Subject:".htmlspecialchars(iconv("UTF-8","ISO-8859-1//TRANSLIT",$r->subject)).""; if($r->bodyhtml) { - $body=iconv("utf-8","ISO-8859-1",$r->bodyhtml); + $body=iconv("UTF-8","ISO-8859-1//TRANSLIT",$r->bodyhtml); + } + else { + $body=nl2br(htmlspecialchars(iconv("UTF-8","ISO-8859-1//TRANSLIT",$r->body))); } - else - $body=nl2br(htmlspecialchars(iconv("utf-8","ISO-8859-1",$r->body))); echo "".$body.""; @@ -742,8 +743,7 @@ case "email_get_list": if(!function_exists("exec")) { echo "
Sending requires php's exec() function to be available
\n"; } - else - { + else { echo ""; echo "
"; echo ""; diff --git a/db/db.update.155.php b/db/db.update.155.php index 4f94908..ac37780 100644 --- a/db/db.update.155.php +++ b/db/db.update.155.php @@ -3,16 +3,12 @@ function db_update_155_post() { //we need to query the stuff from the table $q=mysql_query("SELECT * FROM emails"); - //make the changes to the database - mysql_query("ALTER TABLE `emails` CHANGE `body` `body` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL"); - mysql_query("ALTER TABLE `emails` CHANGE `bodyhtml` `bodyhtml` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL"); - mysql_query("ALTER TABLE `emails` CHANGE `subject` `subject` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL"); - //then update the data while($r=mysql_fetch_object($q)) { + echo "Updating email id $r->id\n"; mysql_query("UPDATE emails SET - body='".mysql_real_escape_string(iconv("ISO-8859-1","UTF-8",$r->body))."' , - bodyhtml='".mysql_real_escape_string(iconv("ISO-8859-1","UTF-8",$r->bodyhtml))."' , - subject='".mysql_real_escape_string(iconv("ISO-8859-1","UTF-8",$r->subject))."' + body='".mysql_real_escape_string(iconv("ISO-8859-1","UTF-8//TRANSLIT",$r->body))."' , + bodyhtml='".mysql_real_escape_string(iconv("ISO-8859-1","UTF-8//TRANSLIT",$r->bodyhtml))."' , + subject='".mysql_real_escape_string(iconv("ISO-8859-1","UTF-8//TRANSLIT",$r->subject))."' WHERE id='$r->id'"); } } diff --git a/db/db.update.155.sql b/db/db.update.155.sql index f7977ab..6c8e8ab 100644 --- a/db/db.update.155.sql +++ b/db/db.update.155.sql @@ -1,3 +1,6 @@ +ALTER TABLE `emails` CHANGE `body` `body` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; +ALTER TABLE `emails` CHANGE `bodyhtml` `bodyhtml` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; +ALTER TABLE `emails` CHANGE `subject` `subject` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; ALTER TABLE `emailqueue` CHANGE `body` `body` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; ALTER TABLE `emailqueue` CHANGE `bodyhtml` `bodyhtml` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; ALTER TABLE `emailqueue` CHANGE `subject` `subject` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; diff --git a/db/db_update.php b/db/db_update.php index b414509..14b5fce 100644 --- a/db/db_update.php +++ b/db/db_update.php @@ -22,6 +22,7 @@ else mysql_connect($DBHOST,$DBUSER,$DBPASS); mysql_select_db($DBNAME); +@mysql_query("SET NAMES latin1"); $q=mysql_query("SELECT val FROM config WHERE var='DBVERSION' AND year='0'"); $r=mysql_fetch_object($q); $dbdbversion=$r->val;