开发者

preg_match Vs preg_match_all browser error not php?

Hi all i have the following:

$str = base64_encode(preg_replace("#\s|\r|\t|\n#", " ", file_get_contents("../www.cms.actwebdesigns.co.uk2/logged.php")));
if(preg_replace("#(PD9waHAg)((?!(Pz4g)).)*#is", $str, ))
{
    #print_r($matches);
    echo "<xmp>".base64_decode($matches[0]."Pz4g")."</xmp>";
}

now this works but i want to be able to use it for all occurre开发者_如何学运维nces on page. (finds php segments in page) So i used preg_match_all but returns a browser error (page has been moved or no longer exists) Anyone know why?


This is a real longshot, but I seem to recall some versions of Internet Explorer having a "feature" where so-called friendly error messages were be displayed for pages where:

  • an error status code (e.g. 404 Not Found) was returned, and
  • the actual HTML response was smaller than a certain number of bytes.

If your code was sending an error response already, and the change to preg_match_all() ended up shortening the output enough, it may have triggered the friendly error message.

If you're not using IE, or if your script is returning a non-error status code, then I have no idea what could be causing this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜