We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32982
    • 674 Posts
    Hello. I have some old sites in Modx Evolution 1.05.
    I update PHP to 5.4.6 and errors starts.
    I patch whith this
    function escape($s) {
          if (function_exists('mysql_real_escape_string') && $this->conn) {
             $s = mysql_real_escape_string($s, $this->conn);
          } else {
    ///////// COMMENT THIS LINE OUT         $s = mysql_escape_string($s); ///////////////
          }
          return $s;
       }
    from https://forums.modx.com/thread/78786/deprecated-escape-function-message and the user KP52.
    But still have problems showings templates, snippets... whith especial spanish chars "á,é,í,ñ...". When saved is stored ok in the database put when reopen sitill ok in database but empty textarea in code.
    Anyone know whats happen. Thanks in advance. [ed. note: xyzvisual last edited this post 14 years ago.]
      Jabiertxof (formerly XYZVISUAL)
      My bussines: http://marker.es
      https://www.youtube.com/user/jabiertxof/videos
      • 32982
      • 674 Posts
      Besides the above, the functions of PHP: htmlentities and htmlentities, have changed in PHP 5.4 of ISO8859-1 charset to UTF8 in their default values​​.
      If anyone has problems displaying a matter of accents include the following code in the header of / manager / inculdes / protect.inc.php.

      <?php
      /**
       *    Protect against some common security flaws
       */
      //functions to bypass charset in htmlspecialchars and htmlentities
      function htmlentitiesSuffix($string, $flags = "ENT_COMPAT | ENT_HTML401", $encoding = 'ISO-8859-15', $double_encode = true){
      return htmlentities ( $string ,(int)$flags, $encoding, $double_encode);
      }
      function htmlspecialcharsSuffix($string, $flags = "ENT_COMPAT | ENT_HTML401", $encoding = 'ISO-8859-15', $double_encode = true){
      return htmlspecialchars ( $string ,(int)$flags, $encoding, $double_encode);
      }
      


      Having before renaming all occurrences of these two functions to new htmlentitiesSuffix and htmlentitiesSuffix
        Jabiertxof (formerly XYZVISUAL)
        My bussines: http://marker.es
        https://www.youtube.com/user/jabiertxof/videos