secureString() does now no longer encode in entities by default, XHTML fixes, missing...
authorRoland Häder <roland@mxchange.org>
Sun, 1 Nov 2009 13:57:54 +0000 (13:57 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 1 Nov 2009 13:57:54 +0000 (13:57 +0000)
inc/libs/security_functions.php
inc/modules/member/what-unconfirmed.php
templates/de/html/theme/theme_one.tpl
templates/de/html/theme/theme_select_box.tpl

index c42280607d9cb8064074bf6b4aeba616d2916af3..a1f681326902fb4041be2cab8ddb58ceada5612d 100644 (file)
@@ -51,15 +51,20 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
  * @param      $strip  Strip tags
  * @return     $str    A (hopefully) secured string against XSS and other bad things
  */
-function secureString ($str, $strip=true) {
+function secureString ($str, $strip = true, $encode = false) {
        // Shall we strip HTML code?
        if ($strip === true) $str = strip_tags($str);
 
        // Trim string
        $str = trim($str);
 
-       // Encode in entities
-       $str = htmlentities($str, ENT_QUOTES);
+       // Encode in entities if requested
+       if ($encode === true) {
+               // Encode in entities (this breakes UTF-8!)
+               $str = htmlentities($str, ENT_QUOTES);
+       } // END - if
+
+       // Return result
        return $str;
 }
 
@@ -71,17 +76,17 @@ ini_set('magic_quotes_gpc', false); // This may not work on some systems
 if (!isset($_SERVER)) {
        global $_SERVER;
        $_SERVER = $GLOBALS['_SERVER'];
-}
+} // END - if
 
 if (!isset($_GET)) {
        global $_GET;
        $_GET = $GLOBALS['_GET'];
-}
+} // END - if
 
 if (!isset($_POST)) {
        global $_POST;
        $_POST = $GLOBALS['_POST'];
-}
+} // END - if
 
 // Include IP-Filter here
 //require("/usr/share/php/ipfilter.php");
@@ -89,7 +94,7 @@ if (!isset($_POST)) {
 // Generate arrays which holds the relevante chars to replace
 $GLOBALS['security_chars'] = array(
        // The chars we are looking for...
-       'from' => array('{', '}', '/', '.', "'", "$", '(', ')', '{--', '--}', '{?', '?}', '%', ';', '[', ']', ':', '--'),
+       'from' => array('{', '}', '/', '.', "'", '$', '(', ')', '{--', '--}', '{?', '?}', '%', ';', '[', ']', ':', '--'),
        // ... and we will replace to.
        'to'   => array(
                '{OPEN_ANCHOR2}',
index 5c1a4d65833e3c37217a14dca52a73c638d95c1f..9632ab6f4361ac3fce85ce702a1e79f5c2422275 100644 (file)
@@ -68,7 +68,7 @@ LIMIT 1",
        $content['category']  = getCategory($content['cat_id']);
        $content['points']    = translateComma($content['points']);
        $content['is_notify'] = translateYesNo($content['is_notify']);
-       $content['sender']    = getMessage('_ADMIN_SHORT');
+       $content['sender']    = getMessage('USERNAME_ADMIN_SHORT');
        $content['time']      = createFancyTime($content['time']);
        $content['userid']    = getUserId();
 
@@ -197,7 +197,7 @@ LIMIT 1",
                                $sender = bigintval($sender);
                        } elseif ($type == 'bonusid') {
                                // Is admin
-                               $sender = getMessage('_ADMIN_SHORT');
+                               $sender = getMessage('USERNAME_ADMIN_SHORT');
                        } else {
                                // Deleted
                                $sender = getMessage('EMAIL_STATUS_DELETED');
index 11bff0301ce469c3475ea65be126ee2035af104e..070abdbccbf6133a3eb2b23c0dd5ae63a0003326 100644 (file)
@@ -1,5 +1,5 @@
 {--CURR_THEME_IS_1--}
-<br />
-<div class="theme_note">$content</div>
-<br />
+<div class="theme_note">
+       $content
+</div>
 {--CURR_THEME_IS_2--}
index 704d93be6d90c053d2099ae3f6e30a249e619935..a2fd10785da53067ed4751a58e15e0e6732f66ae 100644 (file)
@@ -1,7 +1,5 @@
-<table border="0" cellspacing="0" cellpadding="0" class="theme_box">
-       <tr>
-               <td align="center" class="theme_content">
-                       $content
-               </td>
-       </tr>
-</table>
+<div class="theme_box">
+       <div align="center" class="theme_content">
+               $content
+       </div>
+</div>