Replace ereg*() by preg_*()

ereg() triggers deprecated error which is sent to custom error handlers.
It is also faster.
There are no more deprecated functions except mysql_connect().
This commit is contained in:
Jakub Vrana
2013-07-24 16:26:41 -07:00
parent 34349f1482
commit e8c6ef04d2
33 changed files with 705 additions and 705 deletions

View File

@@ -9,7 +9,7 @@
class AdminerSlugify {
/** @access protected */
var $from, $to;
/**
* @param string find these characters ...
* @param string ... and replace them by these
@@ -18,7 +18,7 @@ class AdminerSlugify {
$this->from = $from;
$this->to = $to;
}
function editInput($table, $field, $attrs, $value) {
static $slugify;
if (!$_GET["select"] && !$_GET["where"]) {
@@ -26,7 +26,7 @@ class AdminerSlugify {
$slugify = array();
$prev = null;
foreach (fields($table) as $name => $val) {
if ($prev && ereg('(^|_)slug(_|$)', $name)) {
if ($prev && preg_match('~(^|_)slug(_|$)~', $name)) {
$slugify[$prev] = $name;
}
$prev = $name;
@@ -38,5 +38,5 @@ class AdminerSlugify {
}
}
}
}