From 004ac1c782f5a71e80305e0feeb8407ac22c5ba0 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 23 Feb 2025 17:04:43 +0100 Subject: [PATCH] Use less brackets --- adminer/call.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/adminer/call.inc.php b/adminer/call.inc.php index 1e753870..3bb25bc7 100644 --- a/adminer/call.inc.php +++ b/adminer/call.inc.php @@ -94,12 +94,12 @@ if ($in) { function pre_tr($s) { return preg_replace('~^~m', '', preg_replace('~\|~', '', preg_replace('~\|$~m', "", rtrim($s)))); } -$table = '(?:\+--[-+]+\+\n)'; -$row = '(?:\| .* \|\n)'; +$table = '(\+--[-+]+\+\n)'; +$row = '(\| .* \|\n)'; echo - preg_replace_callback("~^($table?)($row)$table?($row*)$table?~m", function ($match) { + preg_replace_callback("~^$table?$row$table?($row*)$table?~m", function ($match) { $first_row = pre_tr($match[2]); - return "\n" . ($match[1] ? "$first_row\n" : $first_row) . pre_tr($match[3]) . "\n
"; + return "\n" . ($match[1] ? "$first_row\n" : $first_row) . pre_tr($match[4]) . "\n
"; }, preg_replace('~(\n( -|mysql)> )(.+)~', "\\1\\3", preg_replace('~(.+)\n---+\n~', "\\1\n",