Removed: Function eregi() and eregi_replace()
Added: preg_match() and preg_replace()
This commit is contained in:
@@ -1818,7 +1818,8 @@ function get_plugins() {
|
|||||||
function lookup($target) {
|
function lookup($target) {
|
||||||
global $ntarget;
|
global $ntarget;
|
||||||
$msg = $target . ' => ';
|
$msg = $target . ' => ';
|
||||||
if( eregi('[a-zA-Z]', $target) )
|
//if( eregi('[a-zA-Z]', $target) )
|
||||||
|
if( preg_match('[a-zA-Z]', $target) ) //Made compatible to PHP 5.3
|
||||||
$ntarget = gethostbyname($target);
|
$ntarget = gethostbyname($target);
|
||||||
else
|
else
|
||||||
$ntarget = gethostbyaddr($target);
|
$ntarget = gethostbyaddr($target);
|
||||||
|
|||||||
@@ -115,7 +115,8 @@ if( isset($request) ){
|
|||||||
|
|
||||||
} catch(Exception $e){
|
} catch(Exception $e){
|
||||||
$err = $e->getMessage();
|
$err = $e->getMessage();
|
||||||
$err = eregi_replace("[\n|\r|\n\r]", ' ', $err);
|
//$err = eregi_replace("[\n|\r|\n\r]", ' ', $err);
|
||||||
|
$err = preg_replace("[\n|\r|\n\r]", ' ', $err);//Made compatible to PHP 5.3
|
||||||
echo '{"status":1, "message":"'.$err.'"}';
|
echo '{"status":1, "message":"'.$err.'"}';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -138,7 +139,8 @@ if( isset($request) ){
|
|||||||
echo '{status:0, message:"success"}';
|
echo '{status:0, message:"success"}';
|
||||||
}catch( Exception $e){
|
}catch( Exception $e){
|
||||||
$err = $e->getMessage();
|
$err = $e->getMessage();
|
||||||
$err = eregi_replace("[\n|\r|\n\r]", ' ', $err);
|
//$err = eregi_replace("[\n|\r|\n\r]", ' ', $err);
|
||||||
|
$err = preg_replace("[\n|\r|\n\r]", ' ', $err);//Made compatible to PHP 5.3
|
||||||
echo '{result:1, message:"'.$err.'"}';
|
echo '{result:1, message:"'.$err.'"}';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -524,7 +524,8 @@ class G
|
|||||||
*/
|
*/
|
||||||
function lookup($target)
|
function lookup($target)
|
||||||
{
|
{
|
||||||
if( eregi("[a-zA-Z]", $target) )
|
//if( eregi("[a-zA-Z]", $target) )
|
||||||
|
if( preg_match("[a-zA-Z]", $target) )//Made compatible to PHP 5.3
|
||||||
$ntarget = gethostbyname($target);
|
$ntarget = gethostbyname($target);
|
||||||
else
|
else
|
||||||
$ntarget = gethostbyaddr($target);
|
$ntarget = gethostbyaddr($target);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ function node_have_class($root, $target_class) {
|
|||||||
$classes = preg_split("/\s+/", strtolower($root->get_attribute('class')));
|
$classes = preg_split("/\s+/", strtolower($root->get_attribute('class')));
|
||||||
|
|
||||||
foreach ($classes as $class) {
|
foreach ($classes as $class) {
|
||||||
if ($class == $target_class) {
|
if (is_object($target_class) && $class == $target_class) {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ function lookup($target)
|
|||||||
{
|
{
|
||||||
global $ntarget;
|
global $ntarget;
|
||||||
$msg = $target . ' => ';
|
$msg = $target . ' => ';
|
||||||
if( eregi('[a-zA-Z]', $target) )
|
//if( eregi('[a-zA-Z]', $target) )
|
||||||
|
if( preg_match('[a-zA-Z]', $target) ) //Made compatible to PHP 5.3
|
||||||
$ntarget = gethostbyname($target);
|
$ntarget = gethostbyname($target);
|
||||||
else
|
else
|
||||||
$ntarget = gethostbyaddr($target);
|
$ntarget = gethostbyaddr($target);
|
||||||
|
|||||||
@@ -37,7 +37,8 @@
|
|||||||
function lookup($target){
|
function lookup($target){
|
||||||
global $ntarget;
|
global $ntarget;
|
||||||
$msg = "$target => ";
|
$msg = "$target => ";
|
||||||
if( eregi("[a-zA-Z]", $target) )
|
//if( eregi("[a-zA-Z]", $target) )
|
||||||
|
if( preg_match("[a-zA-Z]", $target) ) //Made compatible to PHP 5.3
|
||||||
$ntarget = gethostbyname($target);
|
$ntarget = gethostbyname($target);
|
||||||
else
|
else
|
||||||
$ntarget = gethostbyaddr($target);
|
$ntarget = gethostbyaddr($target);
|
||||||
|
|||||||
@@ -789,7 +789,8 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
|
|||||||
* added by krlos carlos/a/colosa.com
|
* added by krlos carlos/a/colosa.com
|
||||||
* in here we are validation if a xmlform has a submit action
|
* in here we are validation if a xmlform has a submit action
|
||||||
*/
|
*/
|
||||||
if(!eregi('type="submit"',$copy) && !eregi('type="grid"',$copy) && !isset($_SESSION['submitAction']) ){
|
if(!preg_match("/type=\"submit\"/",$copy) && !preg_match("/type=\"grid\"/",$copy) && !isset($_SESSION['submitAction']) ){
|
||||||
|
|
||||||
$_SESSION['submitAction']= 1;
|
$_SESSION['submitAction']= 1;
|
||||||
$answer = 'noSub';
|
$answer = 'noSub';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ function lookup( $target ) {
|
|||||||
global $ntarget;
|
global $ntarget;
|
||||||
$msg = $target . ' => ';
|
$msg = $target . ' => ';
|
||||||
//if (eregi ( '[a-zA-Z]', $target ))
|
//if (eregi ( '[a-zA-Z]', $target ))
|
||||||
if (preg_match( '[a-zA-Z]', $target ))
|
if (preg_match( '[a-zA-Z]', $target )) //Made compatible to PHP 5.3
|
||||||
$ntarget = gethostbyname ( $target );
|
$ntarget = gethostbyname ( $target );
|
||||||
else
|
else
|
||||||
$ntarget = gethostbyaddr ( $target );
|
$ntarget = gethostbyaddr ( $target );
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ $html = '
|
|||||||
'Internet Explorer 4' => '(MSIE 4\.[0-9]+)',
|
'Internet Explorer 4' => '(MSIE 4\.[0-9]+)',
|
||||||
);
|
);
|
||||||
foreach($browsers as $browser=>$pattern){
|
foreach($browsers as $browser=>$pattern){
|
||||||
if (eregi($pattern, $user_agent))
|
if (preg_match($pattern, $user_agent))
|
||||||
return $browser;
|
return $browser;
|
||||||
}
|
}
|
||||||
return 'Unknown';
|
return 'Unknown';
|
||||||
|
|||||||
Reference in New Issue
Block a user