4images Forum & Community

4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: HelpMeNow on June 21, 2006, 10:48:56 PM

Title: Will it pose a security problem if i comment out line 135 in /4images/global.php
Post by: HelpMeNow on June 21, 2006, 10:48:56 PM
I keep getting the following error:

Warning: Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support at offset 1078737888 in /home/httpd/vhosts/mydomain.com/httpdocs/4images/global.php on line 135

There was one other case like this I found on the forum, but the solution didn't work in my case.

QUESTION: Will it pose a security problem if I comment out line 135 in global.php  (When I comment this line out, I don't get the error anymore).
Title: Re: Will it pose a security problem if i comment out line 135 in /4images/global.php
Post by: V@no on June 21, 2006, 11:19:52 PM
When you edit .php files, make sure you save them in ASCII not in UTF8 (Unicode)
Title: Re: Will it pose a security problem if i comment out line 135 in /4images/global.php
Post by: HelpMeNow on June 21, 2006, 11:34:13 PM
When you edit .php files, make sure you save them in ASCII not in UTF8 (Unicode)

Thanks V@no, I have saved in ASCII, but you didn't say if it's safe or not to comment out line 135 in global.php ??? Is it okay to do so?
Title: Re: Will it pose a security problem if i comment out line 135 in /4images/global.php
Post by: V@no on June 21, 2006, 11:38:30 PM
because you didnt show what is on that line (plus 2 lines above and below)
secondly, there is nothing useless in global.php so commenting out something is asking for trouble ;)
Title: Re: Will it pose a security problem if i comment out line 135 in /4images/global.php
Post by: HelpMeNow on June 21, 2006, 11:59:16 PM
because you didnt show what is on that line (plus 2 lines above and below)
secondly, there is nothing useless in global.php so commenting out something is asking for trouble ;)

 :oops: Line 135 is where I've put the " * * * Stars * * * " down in the code:  :oops:

Code: [Select]
  // Remove all control (i.e. with ASCII value lower than 0x20 (space),
  // except of 0x0A (line feed) and 0x09 (tabulator)
  $search2 =
      "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F";
  $replace2 = //str_repeat("\r", strlen($search2));
      "\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D";

  foreach ($array as $key => $val) {
    if (is_array($val)) {
      $val = clean_array($val);
    } else {
******** line 135:      $val = preg_replace($search, $replace, $val);

      $val = str_replace("\r\n", "\n", $val);
      $val = str_replace("\r",   "\n", $val);
      $val = strtr($val, $search2, $replace2);
      $val = str_replace("\r", '', $val);  // \r === \x0D

      do {
        $oldval = $val;
        $val = preg_replace('#</*(applet|meta|xml|blink|link|style|script|embed|object|iframe|frame|frameset|ilayer|layer|bgsound|title|base)[^>]*>#i', "", $val);
      } while ($oldval != $val);
    }

    $array[$key] = $val;
  }

  return $array;
}