Author Topic: Will it pose a security problem if i comment out line 135 in /4images/global.php  (Read 5577 times)

0 Members and 1 Guest are viewing this topic.

Offline HelpMeNow

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
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).

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
When you edit .php files, make sure you save them in ASCII not in UTF8 (Unicode)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline HelpMeNow

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
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?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
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 ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline HelpMeNow

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
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;
}

« Last Edit: June 22, 2006, 12:14:38 AM by HelpMeNow »