1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 12:20:44 +02:00

PHP 5.3+(and NOT 3+ as stated in the previous commit :) ) overall system compatibility

This commit is contained in:
secretr
2010-10-28 10:54:33 +00:00
parent 0cc022ac4c
commit c766c5a8f2
7 changed files with 10 additions and 10 deletions

View File

@@ -913,7 +913,7 @@ function unused($lanfile,$script)
{
if(trim($line) !="")
{
$disabled = (eregi("^//",$line)) ? " (disabled)" : FALSE;
$disabled = (preg_match("#^//#i",$line)) ? " (disabled)" : FALSE;
if($match = getDefined($line))
{
$text .= compareit($match['define'],$compare,$match['value'],$disabled);

View File

@@ -1831,7 +1831,7 @@ class users
if ($head['bounce'])
{
// Its a 'bounce' email
if (ereg('.*X-e107-id:(.*)MIME',$obj->getBody($i),$result))
if (preg_match('/.*X-e107-id:(.*)MIME/',$obj->getBody($i),$result))
{
if ($result[1])
{

View File

@@ -98,7 +98,7 @@ function imageselector_shortcode($parm = '', $mod = '')
{
$dir = str_replace($paths, "", $icon['path']);
if (!$filter || ($filter && ereg($filter, $dir.$icon['fname'])))
if (!$filter || ($filter && preg_match('~'.$filter.'~', $dir.$icon['fname'])))
{
$pth = $dir;
if($fullpath)

View File

@@ -97,7 +97,7 @@ class email_validation_class
$this->preg=(function_exists("preg_match") ? "/".str_replace("/", "\\/", $this->email_regular_expression)."/" : "");
return($this->ValidateEmailAddress($email));
}
return(eregi($this->email_regular_expression,$email)!=0);
return(preg_match("/".str_replace("/", "\\/", $this->email_regular_expression)."/i", $email)/*!=0*/);
}
Function ValidateEmailHost($email,&$hosts)
@@ -156,7 +156,7 @@ class email_validation_class
for($host=0;$host<count($hosts);$host++)
{
$domain=$hosts[$host];
if(ereg('^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$',$domain))
if(preg_match('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/',$domain))
$ip=$domain;
else
{

View File

@@ -30,7 +30,7 @@ if (USER_AREA == TRUE)
*
*/
if (((e_PAGE == "comment.php") || (eregi('extend', e_QUERY))) && ($fb->fb_uid))
if (((e_PAGE == "comment.php") || (stripos(e_QUERY, 'extend') !== FALSE)) && ($fb->fb_uid))
{
echo '<script type="text/javascript">

View File

@@ -6,12 +6,12 @@ $search_info[$key]['qtype'] = "FAQs";
if($results = $sql -> db_Select("faqs", "*", "faq_question REGEXP('".$query."') OR faq_answer REGEXP('".$query."') ORDER BY faq_id DESC ")){
while($row = $sql -> db_Fetch()){
extract($row);
if(eregi($query, $faq_question)){
if(preg_match('/'.str_replace('/', '\\/', $query).'/i', $faq_question)){
$que = parsesearch($faq_question, $query);
$ans = substr($faq_answer, 0,70);
$text .= "<img src=\"".THEME."images/bullet2.gif\" alt=\"bullet\" /> <b><a href=\"".e_PLUGIN."faqs/faqs.php?cat.".$faq_parent.".".$faq_id."\">".$que."</a></b><br /><span class=\"smalltext\">Match found in faq question</span><br />".$ans."<br /><br />";
}
if(eregi($query, $faq_answer)){
if(preg_match('/'.str_replace('/', '\\/', $query).'/i', $faq_answer)){
$resmain = parsesearch($faq_answer, $query);
$text .= "<img src=\"".THEME."images/bullet2.gif\" alt=\"bullet\" /> <b><a href=\"".e_PLUGIN."faqs/faqs.php?cat.".$faq_parent.".".$faq_id."\">".$faq_question."</a></b><br /><span class=\"smalltext\">Match found in faq answer</span><br />".$resmain."<br /><br />";
}

View File

@@ -330,7 +330,7 @@ class rssCreate
$this -> rssItems[$k]['title'] = $row['title'];
if($row['link'])
{
if(eregi("http",$row['link']))
if(stripos($row['link'], 'http') !== FALSE)
{
$this -> rssItems[$k]['link'] = $row['link'];
}
@@ -361,7 +361,7 @@ class rssCreate
$this -> rssItems[$k]['category_name'] = $row['category_name'];
if($row['category_link'])
{
if(eregi("http",$row['category_link']))
if(stripos($row['category_link'], 'http') !== FALSE)
{
$this -> rssItems[$k]['category_link'] = $row['category_link'];
}