Explorar el Código

remove html formating from error messages. XSS fixes sanitize errors and display "

tokul hace 20 años
padre
commit
97375914c1
Se han modificado 2 ficheros con 6 adiciones y 8 borrados
  1. 2 4
      functions/abook_database.php
  2. 4 4
      functions/abook_local_file.php

+ 2 - 4
functions/abook_database.php

@@ -317,8 +317,7 @@ class abook_database extends addressbook_backend {
         /* See if user exist already */
         $ret = $this->lookup($userdata['nickname']);
         if (!empty($ret)) {
-            return $this->set_error(sprintf(_("User %s already exists"),
-                        '"' . $ret['nickname'] . '"'));
+            return $this->set_error(sprintf(_("User \"%s\" already exists"),$ret['nickname']));
         }
 
         /* Create query */
@@ -398,8 +397,7 @@ class abook_database extends addressbook_backend {
          /* See if user exist */
         $ret = $this->lookup($alias);
         if (empty($ret)) {
-            return $this->set_error(sprintf(_("User %s does not exist"),
-                        '&qout;' . $alias . '&qout;'));
+            return $this->set_error(sprintf(_("User \"%s\" does not exist"),$alias));
         }
 
         /* Create query */

+ 4 - 4
functions/abook_local_file.php

@@ -361,8 +361,8 @@ class abook_local_file extends addressbook_backend {
         /* See if user exists already */
         $ret = $this->lookup($userdata['nickname']);
         if(!empty($ret)) {
-            return $this->set_error(sprintf(_("User %s already exists"),
-                        '"' . $ret['nickname'] . '"'));
+            // i18n: don't use html formating in translation
+            return $this->set_error(sprintf(_("User \"%s\" already exists"),$ret['nickname']));
         }
 
         /* Here is the data to write */
@@ -454,8 +454,8 @@ class abook_local_file extends addressbook_backend {
         /* See if user exists */
         $ret = $this->lookup($alias);
         if(empty($ret)) {
-            return $this->set_error(sprintf(_("User %s does not exist"),
-                        '"' . $alias . '"'));
+            // i18n: don't use html formating in translation
+            return $this->set_error(sprintf(_("User \"%s\" does not exist"),$alias));
         }
 
         /* Lock the file to make sure we're the only process working