Example #1 preg_replace_callback() 和 匿名函数 ...
分类:
其他好文 时间:
2017-06-11 10:09:01
阅读次数:
215
来源:http://wooyun.jozxing.cc/static/bugs/wooyun-2015-0137991.html 先通过uc_key把恶意代码保存在/uc_client/data/cache/badwords.php,然后利用preg_replace() 进行任意代码执行。 先附上来 ...
分类:
Web程序 时间:
2017-06-02 20:27:12
阅读次数:
1218
在subject中搜索pattern, 以replacement进行替换。 ...
分类:
Web程序 时间:
2017-06-01 12:01:44
阅读次数:
155
ecshop是一套开源的商城系统,由于出现较早,很多写法不支持较高版本的PHP,目前PHP5.2对ecshop的支持很少。 一般在高版本的PHP中,会出现一些问题,下面是一些在网上找到的答案,经过自己测试可用。 错误1、 Deprecated: preg_replace(): The /e modi ...
分类:
Web程序 时间:
2017-05-20 14:57:08
阅读次数:
382
function filter_emoji_string($str){ $str = trim($str); $str = preg_replace_callback('/./u',function (array $match) {return strlen($match[0]) >= 4 ? '' ...
分类:
Web程序 时间:
2017-05-17 21:08:28
阅读次数:
265
PHP中替换换行符 //php 有三种方法来解决 //1、使用str_replace 来替换换行 $str = str_replace(array("\r\n", "\r", "\n"), "", $str); //2、使用正则替换 $str = preg_replace('//s*/', '', ...
分类:
Web程序 时间:
2017-05-17 17:16:46
阅读次数:
232
近期serverphp版本号升级到了 5.6 发现出了非常多警告 preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead 一開始没注意。后来发现 非常多这种警告,于是网上查了下 发现 php5. ...
分类:
Web程序 时间:
2017-05-11 11:43:01
阅读次数:
192
PHP代码 $str = preg_replace("/(<a.*?>)(.*?)(<\/a>)/", '\1<span class="link">\2</span>\3', $str); 其中用了三个子模式(每个圆括号中内容为一个子模式),第一个是链接开始标签,第二个是链接文本,第三个是</a> ...
分类:
Web程序 时间:
2017-05-07 10:09:00
阅读次数:
230
PHP 5.3 ereg() 无法正常使用,提示“Function ereg() is deprecated Error”是因为它长ereg 函数进行了升级处理,需要像preg_match使用/ /来规则了,当然也是php5.3把ereg给废掉的节奏了。 PHP 5.3 ereg() 无法正常使用, ...
分类:
其他好文 时间:
2017-05-03 17:11:11
阅读次数:
200
一个过虑xxs的代码 public static function removeXSS($str) { $str = str_replace('<!-- -->', '', $str); $str = preg_replace('~/\*[ ]+\*/~i', '', $str); $str = p ...
分类:
Web程序 时间:
2017-04-26 16:44:46
阅读次数:
206