A PHP Bug?

Source: Internet
Author: User
Test environment: Windows Server2003 + PHP5.3.5 _ TS + Apache2.2.19

Create 1.php and put it in the localhot root directory. The file content is as follows:

<? Php

Set_error_handler (function (){
Echo 'error occurred ';
});
Set_exception_handler (function (){
Echo 'error occurred ';
});
Error_reporting (E_ALL &~ E_NOTICE );
// A piece of html text
$ Html = '<div class = "play_video"> <div id = "div_D65EEBE0-2955-A608-27A6-CB5713579FC2"> </div> <script type = "text/javascript"> swfobject. embedSWF ("/flash/player.swf", "div_D65EEBE0-2955-A608-27A6-CB5713579FC2", "500", "300", "9.0.0", "/flash/expressInstall.swf", {file: "/videos/2011/12/26/15/channels" },{ wmode: "opaque", allowfullscreen: "true", allowscriptaccess: "always" },{ id: "player_D65EEBE0-2955-A608-27A6-CB5713579FC2 ", wmode: "opaque"}); </script> ';
// A regular expression for removing script Blocks
$ Reg = '# <script [^>] *> (((?! (? <! [\ '""]) <\/? Script> (?! [\ '""]) [\ S \ S]) *) </script> # I ';
// Replace the regular expression, remove the script, and kill the current http connection when executing this sentence, the status code of this connection was found to be 0 using Fiddler monitoring (no status code found online. 0 indicates what it means)
$ Html = preg_replace ($ reg, '', $ html );
Echo $ html;
?>

Open http: // localhost/1.php in Chrome, and the following error occurs: 324 (net: ERR_EMPTY_RESPONSE): the server is disconnected and no data is sent.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.