mirror of
https://github.com/vrana/adminer.git
synced 2025-08-15 11:04:02 +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:
@@ -4,7 +4,7 @@ if ($_GET["script"] == "kill") {
|
||||
|
||||
} elseif (list($table, $id, $name) = $adminer->_foreignColumn(column_foreign_keys($_GET["source"]), $_GET["field"])) {
|
||||
$limit = 11;
|
||||
$result = $connection->query("SELECT $id, $name FROM " . table($table) . " WHERE " . (ereg('^[0-9]+$', $_GET["value"]) ? "$id = $_GET[value] OR " : "") . "$name LIKE " . q("$_GET[value]%") . " ORDER BY 2 LIMIT $limit");
|
||||
$result = $connection->query("SELECT $id, $name FROM " . table($table) . " WHERE " . (preg_match('~^[0-9]+$~', $_GET["value"]) ? "$id = $_GET[value] OR " : "") . "$name LIKE " . q("$_GET[value]%") . " ORDER BY 2 LIMIT $limit");
|
||||
for ($i=1; ($row = $result->fetch_row()) && $i < $limit; $i++) {
|
||||
echo "<a href='" . h(ME . "edit=" . urlencode($table) . "&where" . urlencode("[" . bracket_escape(idf_unescape($id)) . "]") . "=" . urlencode($row[0])) . "'>" . h($row[1]) . "</a><br>\n";
|
||||
}
|
||||
|
Reference in New Issue
Block a user