zoukankan      html  css  js  c++  java
  • 一个PHP的Bug?

    测试环境:Windows Server2003 + PHP5.3.5_TS + Apache2.2.19

    新建1.php,放在localhot根目录下,文件内容如下:

     <?php

    set_error_handler(function() {
                echo '出错了';
            });
    set_exception_handler(function() {
                echo '出错了';
            });
    error_reporting(E_ALL & ~E_NOTICE);
    //一段html文本
    $html = '<div class="play_video"><div id="div_D65EEBE0-2955-A608-27A6-CB5713579FC2"></div></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/3F5F5136-0200-A646-5B48-C5C4D9ED1C3B.flv"}, {wmode:"opaque",allowfullscreen:"true", allowscriptaccess:"always"}, {id: "player_D65EEBE0-2955-A608-27A6-CB5713579FC2",wmode:"opaque"});</script>';
    //一个去除script脚本块的正则
    $reg = '#<script[^>]*>(((?!(?<![\'""])<\/?script>(?![\'""]))[\s\S])*)</script>#i';
    //正则替换,去除脚本,执行此句的时候杀死了当前的http连接,用Fiddler监控发现此连接的状态码为0(网上没有搜索到状态码为0表示什么意思)
    $htmlpreg_replace($reg, '', $html);
    echo $html;
    ?>

     用Chrome浏览器,打开http://localhost/1.php,提示:错误 324 (net::ERR_EMPTY_RESPONSE):服务器已断开连接,且未发送任何数据。

  • 相关阅读:
    systemctld 启动理解
    公私钥(证书)理解
    布隆过滤器
    python linux下dbg
    iOS基础尺寸图
    metadataObjectTypes 详解
    pkg_config_path 环境变量设置 教程
    Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private 解决方案
    docker php安装GD扩展
    mysql 隔离级别
  • 原文地址:https://www.cnblogs.com/mxw09/p/2393950.html
Copyright © 2011-2022 走看看