mirror of
https://github.com/vrana/adminer.git
synced 2026-07-19 20:30:31 +02:00
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:
@@ -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 {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user