`
yushine
  • 浏览: 197022 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

PHP5.3后(set_magic_quotes_runtime(),ereg() )已经关闭

    博客分类:
  • PHP
阅读更多

运行php程序出现以下错误
Deprecated: Function set_magic_quotes_runtime() is deprecated


导致这个提示的原因是在PHP5.3后此特性(set_magic_quotes_runtime())已经关闭。
而且在PHP6中已经完全移除此特性。
你可以注释或者删除掉出错的行,或者是在set_magic_quotes_runtime()前面加@符号。


PHP 5.3 ereg() 无法正常使用,提示“Function ereg() is deprecated Error”。问题根源是php中有两种正则表示方法,一个是posix,一个是perl,php6打算废除posix的正则表示方法所以后来就加了个 preg_match。此问题解决办法很简单,在ereg前加个过滤提示信息符号即可:把ereg()变成@ereg()。这样屏蔽了提示信息,但根本问 题还是没有解决,php在5.2版本以前ereg都使用正常,在5.3以后,就要用preg_match来代替ereg。所以就需要变成这样,原来:

ereg("^[0-9]*$",$page)

变成:

preg_match("/^[0-9]*$/",$page)

特别提醒:posix与perl的很明显的表达区别就是是否加斜杠,所以与ereg相比,后者在正则的前后分别增加了两个”/”符号,不能缺少。
Tips:此问题在php5.2之前版本不会出现。

Function ereg() is deprecated in drupal-6.15\includes\file.inc on line 904
open the file.inc in a good text editor other than notepad, go to the line number 904 to see the following line. Then comment the line and in the next line type the replaced code. this will solve the instalation issues and also most of other issues related to the same issue.

Change
elseif ($depth >= $min_depth && ereg($mask, $file)) {

to
elseif ($depth >= $min_depth && mb_ereg($mask, $file)) {

mb_ereg fortunatly is not deprecated
分享到:
评论

相关推荐

    php set_magic_quotes_runtime() 函数过时解决方法

    把函数: set_magic_quotes_runtime($new_setting); 替换成: ini_set(“magic_quotes_runtime”, $new_setting);

    基于magic_quotes_gpc与magic_quotes_runtime的区别与使用介绍

    本篇文章小编为大家介绍,基于magic_quotes_gpc与magic_quotes_runtime的区别与使用介绍。需要的朋友参考下

    get_magic_quotes函数详解

    get_magic_quget_magic_quotes函数详解oget_magic_quotes函数详解get_magic_quoget_magic_quotes函数详解get_magic_quotes函数详解get_magic_quotes函数详解get_magic_quotes函数详解tes函数详解get_magic_quotes...

    php中get_magic_quotes_gpc()函数说明

    get_magic_quotes_gpc函数是一个用来判断是否为用户提供的数据增加斜线了,这个在php.ini配置文件中哦,下面我来介绍一下get_magic_quotes_gpc()函数说明. get_magic_quotes_gpc函数介绍 取得 PHP 环境变数 magic_...

    phpmailer v5.1 新版本,支持gmail,有各种示例

    phpmailer v5.1 新版本,支持gmail、网易邮箱,包含示例。... set_magic_quotes_runtime(0); } 5、如果您的包比较老(v2.3之前)在windows 下要注释掉: //$mail->IsSendmail(); // tell the class to use Sendmail

    深入PHP magic quotes的详解

    中去配置的,从手册中可以看出从php5.3后已经废除了这些特性,所以强烈大家不要使用,在php.ini中关闭它。 这些函数的作用是对数据进行转义。防止sql注入的时候,很多人会这样写:复制代码 代码如下:if(!get_magic_...

    php参数过滤、数据过滤类

    中开启magic_quotes_gpc和magic_quotes_runtime。magic_quotes_gpc可以把get,post,cookie里的引号变为斜杠。magic_quotes_runtime对于进出数据库的数据可以起到格式话的作用。其实,早在以前注入很疯狂时,这个参数...

    php5.3 废弃函数小结

    在php5.3被放弃的函数有: ereg();//直接用mb_ereg代替,或是... set_magic_quotes_runtime(); split(); mysql_close(); // 将不支持全部关闭, 需要改为:mysql_close($link); 您可能感兴趣的文章:Ubuntu12下编译安装

    php参数过滤、数据过滤类.zip

    中开启magic_quotes_gpc和magic_quotes_runtime。magic_quotes_gpc可以把get,post,cookie里的引号变为斜杠。magic_quotes_runtime对于进出数据库的数据可以起到格式话的作用。其实,早在以前注入很疯狂时,这个参数...

    PHP5下$_SERVER变量不再受magic_quotes_gpc保护的弥补方法

    php $magic_quotes_gpc = get_magic_quotes_gpc(); @extract(daddslashes($_COOKIE)); @extract(daddslashes($_POST)); @extract(daddslashes($_GET)); if(!$magic_quotes_gpc) { $_FILES = daddslashes($_FILES); }...

    php magic_quotes_gpc的一点认识与分析

    blankyao 说“学习的过程就是不断的发现错误,不断的改正错误”;... It’s preferred to code with magic quotes off and to instead escape the data at runtime, as needed. What are Magic Quotes 代码: When o

    基于PHP magic_quotes_gpc的使用方法详解

    本篇文章是对PHP中magic_quotes_gpc的使用方法进行了详细的分析介绍,需要的朋友参考下

    php-magic-quotes-gpc:在PHP 5.4更高版本上为旧版代码实现magic_quotes_gpc

    PHP魔术引号实现在PHP 5.4更高版本上为旧版代码实现magic_quotes_gpc 如果您要将旧版源代码迁移到上述PHP 5.4版的环境中,但是根据Magic Quotes magic_quotes_gpc SQL保护,其中包括许多易受攻击的数据库查询代码。...

    PHP数据的提交与过滤基本操作实例详解

    本文实例讲述了PHP数据的提交...中开启magic_quotes_gpc和magic_quotes_runtime。magic_quotes_gpc可以把get,post,cookie里的引号变为斜杠。 magic_quotes_runtime对于进出数据库的数据可以起到格式话的作用。其实,早

    iProber v0.01PHP探针

    增加 magic_quotes_gpc 和 magic_quotes_runtime 两个参数的控测 修正数据IO检测在某些服务器下报错的BUG 修正空余空间检测在某些服务器下报错的BUG

    UcenterPro:修改官网的Ucenter, 支持PHP7

    Ucenter PHP7改动/install/index.php12 ini_set('set_magic_quotes_runtime',0);43 删除 短标签判断更改所有的mysql 成mysqli/api/dbbak.php/install/var.inc.php72 $func_items = array('mysqli_connect', '...

Global site tag (gtag.js) - Google Analytics