ID:               37113
 Updated by:       [EMAIL PROTECTED]
 Reported By:      oliver dot block at lycos dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         PCRE related
 Operating System: Unix
 PHP Version:      5.1.2
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Your regex fetches the GMT, so where is the problem.


Previous Comments:
------------------------------------------------------------------------

[2006-04-17 21:08:55] oliver dot block at lycos dot de

Description:
------------
preg_replace_callback returns content that should not be in memory!

Reproduce code:
---------------
input:

1. "Tue, 11 Apr 2006 17:09:22 GMT"
2. "Tue, 11 Apr 2006 20:26:57 +0000 (GMT)"
3. ""


function check_date($s)
{
   $muster = "/(Mon, |Tue, |Wed, |Thu, |Fri, |Sat, |Sun, )?(\d\d?)
(.{3})
(\d\d\d\d) (\d\d:\d\d(:\d\d)?) (([+-](\d\d(\d\d)))|GMT)/";
   $result = "";
   $result = preg_replace_callback($muster, create_function('$match',
                 '$mon = array("Jan" => "01", "Feb" => "02", "Mar" =>
"03",
                               "Apr" => "04", "May" => "05", "Jun" =>
"06",
                               "Jul" => "07", "Aug" => "08", "Sep" =>
"09",
                               "Okt" => "10", "Nov" => "11", "Dez" =>
"12");
                  $mm = $mon[$match[3]];
                  return "{$match[2]}.{$mm}.{$match[4]}";
                 '),
             $s);
   return $result;
}


Expected result:
----------------
1. "11.04.2006"
2. "11.04.2006"
3. ""


Actual result:
--------------
1. "11.04.2006"
2. "11.04.2006 (GMT)"
3. ""



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37113&edit=1

Reply via email to