mirror of
https://github.com/vrana/adminer.git
synced 2026-02-26 00:21:24 +01: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:
@@ -1,35 +1,35 @@
|
||||
<?php
|
||||
function adminer_object() {
|
||||
|
||||
|
||||
class AdminerCds extends Adminer {
|
||||
|
||||
|
||||
function name() {
|
||||
// custom name in title and heading
|
||||
return 'CDs';
|
||||
}
|
||||
|
||||
|
||||
function credentials() {
|
||||
// ODBC user without password on localhost
|
||||
return array('localhost', 'ODBC', '');
|
||||
}
|
||||
|
||||
|
||||
function database() {
|
||||
// will be escaped by Adminer
|
||||
return 'adminer_test';
|
||||
}
|
||||
|
||||
|
||||
function login($login, $password) {
|
||||
// username: 'admin', password: anything
|
||||
return ($login == 'admin');
|
||||
}
|
||||
|
||||
|
||||
function tableName($tableStatus) {
|
||||
// tables without comments would return empty string and will be ignored by Adminer
|
||||
return h($tableStatus["Comment"]);
|
||||
}
|
||||
|
||||
|
||||
function fieldName($field, $order = 0) {
|
||||
if ($order && ereg('_(md5|sha1)$', $field["field"])) {
|
||||
if ($order && preg_match('~_(md5|sha1)$~', $field["field"])) {
|
||||
return ""; // hide hashes in select
|
||||
}
|
||||
// display only column with comments, first five of them plus searched columns
|
||||
@@ -43,9 +43,9 @@ function adminer_object() {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return new AdminerCds;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user