Regexp (?P<>) is not supported with preg_replace_callback in older PHP versions
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@947 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
7b34625b01
commit
175daa360c
|
@ -314,7 +314,10 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5
|
||||||
|
|
||||||
function processInput($field, $value, $function = "") {
|
function processInput($field, $value, $function = "") {
|
||||||
global $dbh;
|
global $dbh;
|
||||||
$return = $dbh->quote(ereg('date|timestamp', $field["type"]) ? preg_replace_callback('(' . preg_replace('~(\\\\\\$([0-9]))~', '(?P<p\\2>[0-9]+)', preg_quote(lang('$1-$3-$5'))) . ')', 'conversion_date', $value) : $value);
|
$return = $dbh->quote(ereg('date|timestamp', $field["type"]) && preg_match('(^' . preg_replace('~(\\\\\\$([0-9]))~', '(?P<p\\2>[0-9]+)', preg_quote(lang('$1-$3-$5'))) . ')', $value, $match)
|
||||||
|
? ($match["p1"] ? $match["p1"] : ($match["p2"] < 70 ? 20 : 19) . $match["p2"]) . "-$match[p3]$match[p4]-$match[p5]$match[p6]"
|
||||||
|
: $value
|
||||||
|
);
|
||||||
if (!ereg('varchar|text', $field["type"]) && $field["full_type"] != "tinyint(1)" && !strlen($value)) {
|
if (!ereg('varchar|text', $field["type"]) && $field["full_type"] != "tinyint(1)" && !strlen($value)) {
|
||||||
$return = "NULL";
|
$return = "NULL";
|
||||||
} elseif (ereg('date|time', $field["type"]) && $value == "CURRENT_TIMESTAMP") {
|
} elseif (ereg('date|time', $field["type"]) && $value == "CURRENT_TIMESTAMP") {
|
||||||
|
|
|
@ -1,4 +1,2 @@
|
||||||
<?php
|
<?php
|
||||||
function conversion_date($match) {
|
|
||||||
return ($match["p1"] ? $match["p1"] : ($match["p2"] < 70 ? 20 : 19) . $match["p2"]) . "-$match[p3]$match[p4]-$match[p5]$match[p6]";
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue