]> dev.renevier.net Git - syj.git/commitdiff
provide charset argument when calling htmlspecialchars
authorarno <arno@renevier.net>
Sat, 19 Mar 2011 14:33:18 +0000 (15:33 +0100)
committerarno <arno@renevier.net>
Sun, 20 Mar 2011 14:46:56 +0000 (15:46 +0100)
application/controllers/GeomController.php
application/forms/Pending/ResetPassword.php
application/forms/Pending/ValidateCreation.php

index 0c399fedd89684f989e17bb860b4e62222117351..1a860b66c968e4eaeb9805037a1698ea1237f63a 100644 (file)
@@ -56,9 +56,11 @@ class GeomController extends Zend_Controller_Action
         $data .= '<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">';
         $data .= '<Placemark>';
         if ($path->creator) {
-            $data .= '<atom:author><atom:name>' . htmlspecialchars($path->creator->pseudo) . '</atom:name></atom:author>';
+            $data .= '<atom:author><atom:name>'
+                        . htmlspecialchars($path->creator->pseudo, ENT_COMPAT, "UTF-8")
+                        . '</atom:name></atom:author>';
         }
-        $data .= '<name>' . htmlspecialchars($path->displayTitle) . '</name>';
+        $data .= '<name>' . htmlspecialchars($path->displayTitle, ENT_COMPAT, "UTF-8") . '</name>';
         $data .= $path->geom->toKML();
         $data .= '</Placemark>';
         $data .= '</kml>';
@@ -72,9 +74,9 @@ class GeomController extends Zend_Controller_Action
         $data .= '<gpx creator="syj" version="1.0" xmlns="http://www.topografix.com/GPX/1/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">';
         $data .= '<trk>';
         if ($path->creator) {
-            $data .= '<author>' . htmlspecialchars($path->creator->pseudo) . '</author>';
+            $data .= '<author>' . htmlspecialchars($path->creator->pseudo, ENT_COMPAT, "UTF-8") . '</author>';
         }
-        $data .= '<name>' . htmlspecialchars($path->displayTitle) . '</name>';
+        $data .= '<name>' . htmlspecialchars($path->displayTitle, ENT_COMPAT, "UTF-8") . '</name>';
         $data .= $path->geom->toGPX();
         $data .= '</trk>';
         $data .= '</gpx>';
index a18c071b38db7684cc2e0a17c485de8adc82427c..bcba21af82c51a73b08423f19c4008818ab914ad 100644 (file)
@@ -9,7 +9,7 @@ class Syj_Form_Pending_ResetPassword extends Syj_Form_Pending
 
         $translator = $this->getTranslator();
         $activatetext = $translator->translate("Hi %s. Someone, probably you, has asked to reset password for your account. To get a new password, validate with following button.");
-        $pseudo = htmlspecialchars($user->pseudo);
+        $pseudo = htmlspecialchars($user->pseudo, ENT_COMPAT, "UTF-8");
         $activatetext = vsprintf ($activatetext, array($pseudo));
 
         return array(
index f8a20f5ff632407e0ed19972415b76b82b1b082b..50284718a2fa58c0bf781720c50defab75c6b34f 100644 (file)
@@ -9,8 +9,8 @@ class Syj_Form_Pending_ValidateCreation extends Syj_Form_Pending
 
         $translator = $this->getTranslator();
         $activatetext = $translator->translate("Someone, probably you, has registered an account %s with email address %s on syj. To confirm this account creation, validate with following button.");
-        $pseudo = '<strong>' . htmlspecialchars('"' . $user->pseudo . '"') . '</strong>';
-        $email = '<strong>' . htmlspecialchars('"' . $user->email . '"') . '</strong>';
+        $pseudo = '<strong>' . htmlspecialchars('"' . $user->pseudo . '"', ENT_COMPAT, "UTF-8") . '</strong>';
+        $email = '<strong>' . htmlspecialchars('"' . $user->email . '"', ENT_COMPAT, "UTF-8") . '</strong>';
         $activatetext = vsprintf ($activatetext, array($pseudo, $email));
 
         return array(