Index: administrator/components/com_admin/admin.admin.html.php
===================================================================
--- administrator/components/com_admin/admin.admin.html.php (revision 12516)
+++ administrator/components/com_admin/admin.admin.html.php (working copy)
@@ -145,7 +145,7 @@
$langTag = 'en-GB'; // use english as fallback
}
- if (!eregi( '\.html$', $page )) {
+ if (!preg_match( '#\.html$#i', $page )) {
$page .= '.xml';
}
?>
Index: administrator/components/com_admin/tmpl/sysinfo_config.php
===================================================================
--- administrator/components/com_admin/tmpl/sysinfo_config.php (revision 12516)
+++ administrator/components/com_admin/tmpl/sysinfo_config.php (working copy)
@@ -32,29 +32,29 @@
$cf = file( JPATH_CONFIGURATION . '/configuration.php' );
$config_output = array();
foreach ($cf as $k => $v) {
- if (eregi( 'var \$host', $v)) {
+ if (preg_match( '#var \$host#i', $v)) {
$cf[$k] = 'var $host = \'xxxxxx\'';
- } else if (eregi( 'var \$user', $v)) {
+ } else if (preg_match( '#var \$user#i', $v)) {
$cf[$k] = 'var $user = \'xxxxxx\'';
- } else if (eregi( 'var \$password', $v)) {
+ } else if (preg_match( '#var \$password#i', $v)) {
$cf[$k] = 'var $password = \'xxxxxx\'';
- } else if (eregi( 'var \$db ', $v)) {
+ } else if (preg_match( '#var \$db#i', $v)) {
$cf[$k] = 'var $db = \'xxxxxx\'';
- } else if (eregi( 'var \$ftp_user ', $v)) {
+ } else if (preg_match( '#var \$ftp_user#i', $v)) {
$cf[$k] = 'var $ftp_user = \'xxxxxx\'';
- } else if (eregi( 'var \$ftp_pass ', $v)) {
+ } else if (preg_match( '#var \$ftp_pass#i', $v)) {
$cf[$k] = 'var $ftp_pass = \'xxxxxx\'';
- } else if (eregi( 'var \$smtpuser ', $v)) {
+ } else if (preg_match( '#var \$smtpuser#i', $v)) {
$cf[$k] = 'var $smtpuser = \'xxxxxx\'';
- } else if (eregi( 'var \$smtppass ', $v)) {
+ } else if (preg_match( '#var \$smtppass#i', $v)) {
$cf[$k] = 'var $smtppass = \'xxxxxx\'';
- } else if (eregi( '', $v)) {
+ } else if (preg_match( '#\?>#i', $v)) {
$cf[$k] = '';
- } else if (eregi( '}', $v)) {
+ } else if (preg_match( '#\}#i', $v)) {
$cf[$k] = '';
- } else if (eregi( 'class JConfig {', $v)) {
+ } else if (preg_match( '#class JConfig \{#i', $v)) {
$cf[$k] = '';
}
$cf[$k] = str_replace('var ','',$cf[$k]);
Index: administrator/components/com_banners/views/banner.php
===================================================================
--- administrator/components/com_banners/views/banner.php (revision 12516)
+++ administrator/components/com_banners/views/banner.php (working copy)
@@ -432,7 +432,7 @@
imageurl)) {
+ } elseif (preg_match("#gif|jpg|png#i", $row->imageurl)) {
?>
webpage) > 0 && (!(eregi('http://', $this->webpage) || (eregi('https://', $this->webpage)) || (eregi('ftp://', $this->webpage))))) {
+ if (strlen($this->webpage) > 0 && (!(preg_match('#http://#i', $this->webpage) || (preg_match('#https://#i', $this->webpage)) || (preg_match('#ftp://#i', $this->webpage))))) {
$this->webpage = 'http://'.$this->webpage;
}
Index: administrator/components/com_weblinks/tables/weblink.php
===================================================================
--- administrator/components/com_weblinks/tables/weblink.php (revision 12516)
+++ administrator/components/com_weblinks/tables/weblink.php (working copy)
@@ -162,7 +162,7 @@
return false;
}
- if (!(eregi('http://', $this->url) || (eregi('https://', $this->url)) || (eregi('ftp://', $this->url)))) {
+ if (!(preg_match('#http://#i', $this->url) || (preg_match('#https://#i', $this->url)) || (preg_match('#ftp://#i', $this->url)))) {
$this->url = 'http://'.$this->url;
}
Index: plugins/system/legacy/adminmenus.php
===================================================================
--- plugins/system/legacy/adminmenus.php (revision 12516)
+++ plugins/system/legacy/adminmenus.php (working copy)
@@ -310,7 +310,7 @@
if ( is_dir( $i_f ) && $file <> 'CVS' && $file <> '.svn') {
$folders[] = JHTML::_('select.option', $ff_ );
mosAdminMenus::ReadImages( $i_f, $ff_, $folders, $images );
- } else if ( eregi( "bmp|gif|jpg|png", $file ) && is_file( $i_f ) ) {
+ } else if ( preg_match( "#bmp|gif|jpg|png#i", $file ) && is_file( $i_f ) ) {
// leading / we don't need
$imageFile = substr( $ff, 1 );
$images[$folderPath][] = JHTML::_('select.option', $imageFile, $file );
Index: plugins/xmlrpc/joomla.php
===================================================================
--- plugins/xmlrpc/joomla.php (revision 12516)
+++ plugins/xmlrpc/joomla.php (working copy)
@@ -102,7 +102,7 @@
foreach ($results as $i=>$rows)
{
foreach ($rows as $j=>$row) {
- $results[$i][$j]->href = eregi('^(http|https)://', $row->href) ? $row->href : JURI::root().'/'.$row->href;
+ $results[$i][$j]->href = preg_match('#^(http|https)://#i', $row->href) ? $row->href : JURI::root().'/'.$row->href;
$results[$i][$j]->text = SearchHelper::prepareSearchContent( $row->text, 200, $searchword);
}
}
Index: templates/ja_purity/ja_templatetools.php
===================================================================
--- templates/ja_purity/ja_templatetools.php (revision 12516)
+++ templates/ja_purity/ja_templatetools.php (working copy)
@@ -180,7 +180,7 @@
//read all files from the directory, checks if are images and ads them to a list (see below how to display flash banners)
while ($file = $imgs->read()) {
- if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
+ if (preg_match("#gif#i", $file) || preg_match("#jpg#i", $file) || preg_match("#png#i", $file))
$imglist[] = $file;
}
closedir($imgs->handle);
Index: installation/includes/bigdump.php
===================================================================
--- installation/includes/bigdump.php (revision 12516)
+++ installation/includes/bigdump.php (working copy)
@@ -127,7 +127,7 @@
// Recognize GZip filename
- if (eregi("\.gz$", $_REQUEST["fn"]))
+ if (preg_match("#\.gz$#i", $_REQUEST["fn"]))
$gzipmode = true;
else
$gzipmode = false;
@@ -155,7 +155,7 @@
// *******************************************************************************************
// START IMPORT SESSION HERE
// *******************************************************************************************
-if (!$error && isset ($_REQUEST["start"]) && isset ($_REQUEST["foffset"]) && eregi("(\.(sql|gz|csv))$", $_REQUEST["fn"])) {
+if (!$error && isset ($_REQUEST["start"]) && isset ($_REQUEST["foffset"]) && preg_match("#(\.(sql|gz|csv))$#i", $_REQUEST["fn"])) {
// Check start and foffset are numeric values
Index: installation/installer/models/model.php
===================================================================
--- installation/installer/models/model.php (revision 12516)
+++ installation/installer/models/model.php (working copy)
@@ -891,7 +891,7 @@
return false;
}
- if( !eregi('.sql$', $sqlFile['name']) )
+ if( !preg_match('#\.sql$#i', $sqlFile['name']) )
{
$archive = JPATH_SITE.DS.'tmp'.DS.$sqlFile['name'];
}
Index: installation/installer/helper.php
===================================================================
--- installation/installer/helper.php (revision 12516)
+++ installation/installer/helper.php (working copy)
@@ -689,7 +689,7 @@
return JText::_('WARNUPLOADFAILURE');
}
- if( !eregi('.sql$', $sqlFile['name']) )
+ if( !preg_match('#\.sql$#i', $sqlFile['name']) )
{
$archive = JPATH_SITE.DS.'tmp'.DS.$sqlFile['name'];
}
Index: modules/mod_random_image/helper.php
===================================================================
--- modules/mod_random_image/helper.php (revision 12516)
+++ modules/mod_random_image/helper.php (working copy)
@@ -81,7 +81,7 @@
{
if (!is_dir($dir .DS. $img))
{
- if (eregi($type, $img)) {
+ if (preg_match("#$type#i", $img)) {
$images[$i]->name = $img;
$images[$i]->folder = $folder;
++$i;
Index: modules/mod_footer/mod_footer.php
===================================================================
--- modules/mod_footer/mod_footer.php (revision 12516)
+++ modules/mod_footer/mod_footer.php (working copy)
@@ -21,13 +21,13 @@
$csite_name = $mainframe->getCfg('sitename');
if (JString::strpos(JText :: _('FOOTER_LINE1'), '%date%')) {
- $line1 = ereg_replace('%date%', $cur_year, JText :: _('FOOTER_LINE1'));
+ $line1 = str_replace('%date%', $cur_year, JText :: _('FOOTER_LINE1'));
} else {
$line1 = JText :: _('FOOTER_LINE1');
}
if (JString::strpos($line1, '%sitename%')) {
- $lineone = ereg_replace('%sitename%', $csite_name, $line1);
+ $lineone = str_replace('%sitename%', $csite_name, $line1);
} else {
$lineone = $line1;
}
Index: modules/mod_mainmenu/helper.php
===================================================================
--- modules/mod_mainmenu/helper.php (revision 12516)
+++ modules/mod_mainmenu/helper.php (working copy)
@@ -28,7 +28,7 @@
*/
class modMainMenuHelper
{
- function buildXML(&$params)
+ function buildXML($params)
{
$menu = new JMenuTree($params);
$items = &JSite::getMenu();
Index: modules/mod_mainmenu/legacy.php
===================================================================
--- modules/mod_mainmenu/legacy.php (revision 12516)
+++ modules/mod_mainmenu/legacy.php (working copy)
@@ -47,8 +47,8 @@
break;
case 'url' :
- if (eregi('index.php\?', $mitem->link)) {
- if (!eregi('Itemid=', $mitem->link)) {
+ if (preg_match('#index.php\?#i', $mitem->link)) {
+ if (!preg_match('#Itemid=#i', $mitem->link)) {
$mitem->link .= '&Itemid='.$mitem->id;
}
}
Index: libraries/pattemplate/patErrorManager.php
===================================================================
--- libraries/pattemplate/patErrorManager.php (revision 12516)
+++ libraries/pattemplate/patErrorManager.php (working copy)
@@ -199,7 +199,7 @@
}
// build error object
- $error =& new $class( $level, $code, $msg, $info );
+ $error = new $class( $level, $code, $msg, $info );
// see what to do with this kind of error
$handling = patErrorManager::getErrorHandling( $level );
Index: libraries/pattemplate/patError.php
===================================================================
--- libraries/pattemplate/patError.php (revision 12516)
+++ libraries/pattemplate/patError.php (working copy)
@@ -257,7 +257,7 @@
if ($formatted && is_array( $this->backtrace )) {
$result = '';
foreach( debug_backtrace() as $back) {
- if (!eregi( 'patErrorManager.php', $back['file'])) {
+ if (!preg_match( '#patErrorManager.php#i', $back['file'])) {
$result .= '
'.$back['file'].':'.$back['line'];
}
}
Index: libraries/pattemplate/patTemplate.php
===================================================================
--- libraries/pattemplate/patTemplate.php (revision 12516)
+++ libraries/pattemplate/patTemplate.php (working copy)
@@ -1421,7 +1421,7 @@
return patErrorManager::raiseError( PATTEMPLATE_ERROR_MODULE_NOT_FOUND, "Module file $moduleFile does not contain class $moduleClass." );
}
- $this->_modules[$moduleType][$sig] = &new $moduleClass;
+ $this->_modules[$moduleType][$sig] = new $moduleClass;
if( method_exists( $this->_modules[$moduleType][$sig], 'setTemplateReference' ) )
{
$this->_modules[$moduleType][$sig]->setTemplateReference( $this );
Index: libraries/joomla/session/session.php
===================================================================
--- libraries/joomla/session/session.php (revision 12516)
+++ libraries/joomla/session/session.php (working copy)
@@ -280,7 +280,7 @@
require_once(dirname(__FILE__).DS.'storage'.DS.$name.'.php');
}
- if(call_user_func_array( array( trim($class), 'test' ), null)) {
+ if(call_user_func_array( array( trim($class), 'test' ), array())) {
$names[] = $name;
}
}
Index: libraries/joomla/language/help.php
===================================================================
--- libraries/joomla/language/help.php (revision 12516)
+++ libraries/joomla/language/help.php (working copy)
@@ -39,7 +39,7 @@
if ($useComponent)
{
- if (!eregi( '\.html$', $ref )) {
+ if (!preg_match( '#\.html$#i', $ref )) {
$ref = $ref . '.html';
}
@@ -77,7 +77,7 @@
// Included html help files
$helpURL = 'help/' .$lang->getTag() .'/';
- if (!eregi( '\.html$', $ref )) {
+ if (!preg_match( '#\.html$#i', $ref )) {
$ref = $ref . '.html';
}
Index: libraries/joomla/cache/cache.php
===================================================================
--- libraries/joomla/cache/cache.php (revision 12516)
+++ libraries/joomla/cache/cache.php (working copy)
@@ -140,7 +140,7 @@
require_once(dirname(__FILE__).DS.'storage'.DS.$name.'.php');
}
- if(call_user_func_array( array( trim($class), 'test' ), null)) {
+ if(call_user_func_array( array( trim($class), 'test' ), array())) {
$names[] = $name;
}
}
Index: libraries/joomla/database/table/user.php
===================================================================
--- libraries/joomla/database/table/user.php (revision 12516)
+++ libraries/joomla/database/table/user.php (working copy)
@@ -148,7 +148,7 @@
return false;
}
- if (eregi( "[<>\"'%;()&]", $this->username) || strlen(utf8_decode($this->username )) < 2) {
+ if (preg_match( "#[<>\"'%;()&]#i", $this->username) || strlen(utf8_decode($this->username )) < 2) {
$this->setError( JText::sprintf( 'VALID_AZ09', JText::_( 'Username' ), 2 ) );
return false;
}
Index: libraries/joomla/database/database.php
===================================================================
--- libraries/joomla/database/database.php (revision 12516)
+++ libraries/joomla/database/database.php (working copy)
@@ -959,7 +959,7 @@
$query = trim( $query );
$this->setQuery( $query );
- if (eregi( '^select', $query )) {
+ if (preg_match('#^select#i', $query )) {
$result = $this->loadRowList();
return new JRecordSet( $result );
} else {
Index: libraries/joomla/html/html/list.php
===================================================================
--- libraries/joomla/html/html/list.php (revision 12516)
+++ libraries/joomla/html/html/list.php (working copy)
@@ -60,7 +60,7 @@
$imageFiles = JFolder::files( JPATH_SITE.DS.$directory );
$images = array( JHTML::_('select.option', '', '- '. JText::_( 'Select Image' ) .' -' ) );
foreach ( $imageFiles as $file ) {
- if ( eregi( $extensions, $file ) ) {
+ if ( preg_match( "#$extensions#i", $file ) ) {
$images[] = JHTML::_('select.option', $file );
}
}
Index: libraries/joomla/html/html.php
===================================================================
--- libraries/joomla/html/html.php (revision 12516)
+++ libraries/joomla/html/html.php (working copy)
@@ -82,8 +82,12 @@
if (is_callable( array( $className, $func ) ))
{
- $args = func_get_args();
- array_shift( $args );
+ $temp = func_get_args();
+ array_shift( $temp );
+ $args = array();
+ foreach ($temp as $k => $v) {
+ $args[] = &$temp[$k];
+ }
return call_user_func_array( array( $className, $func ), $args );
}
else
Index: libraries/phpmailer/phpmailer.php
===================================================================
--- libraries/phpmailer/phpmailer.php (revision 12516)
+++ libraries/phpmailer/phpmailer.php (working copy)
@@ -589,7 +589,7 @@
/* Retry while there is no connection */
while($index < count($hosts) && $connection == false) {
$hostinfo = array();
- if(eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) {
+ if(preg_match('#^(.+):([0-9]+)$#i', $hosts[$index], $hostinfo)) {
$host = $hostinfo[1];
$port = $hostinfo[2];
} else {
Index: libraries/domit/xml_domit_parser.php
===================================================================
--- libraries/domit/xml_domit_parser.php (revision 12516)
+++ libraries/domit/xml_domit_parser.php (working copy)
@@ -3309,7 +3309,7 @@
//parse out whitespace - (XML_OPTION_SKIP_WHITE = 1 does not
//seem to work consistently across versions of PHP and Expat
if (!$this->xmlDoc->preserveWhitespace) {
- $xmlText = eregi_replace('>' . "[[:space:]]+" . '<' , '><', $xmlText);
+ $xmlText = preg_replace('#>' . "[[:space:]]+" . '<#i' , '><', $xmlText);
}
$success = xml_parse($parser, $xmlText);
Index: libraries/domit/xml_domit_lite_parser.php
===================================================================
--- libraries/domit/xml_domit_lite_parser.php (revision 12516)
+++ libraries/domit/xml_domit_lite_parser.php (working copy)
@@ -1746,7 +1746,7 @@
//parse out whitespace - (XML_OPTION_SKIP_WHITE = 1 does not
//seem to work consistently across versions of PHP and Expat
if (!$this->xmlDoc->preserveWhitespace) {
- $xmlText = eregi_replace('>' . "[[:space:]]+" . '<' , '><', $xmlText);
+ $xmlText = preg_replace('#>' . "[[:space:]]+" . '<#i' , '><', $xmlText);
}
$success = xml_parse($parser, $xmlText);
Index: libraries/phpinputfilter/inputfilter.php
===================================================================
--- libraries/phpinputfilter/inputfilter.php (revision 12516)
+++ libraries/phpinputfilter/inputfilter.php (working copy)
@@ -361,7 +361,7 @@
* Remove all "non-regular" attribute names
* AND blacklisted attributes
*/
- if ((!eregi("^[a-z]*$", $attrSubSet[0])) || (($this->xssAuto) && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) || (substr($attrSubSet[0], 0, 2) == 'on'))))
+ if ((!preg_match("#^[a-z]*$#i", $attrSubSet[0])) || (($this->xssAuto) && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) || (substr($attrSubSet[0], 0, 2) == 'on'))))
{
continue;
}