diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index bb7de001..1aa78646 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -399,7 +399,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5 $field = idf_escape($_POST["email_field"]); $subject = $_POST["email_subject"]; $message = $_POST["email_message"]; - preg_match_all('~\\{\\$('#' + [a-z0-9_]+)\\}~i', "$subject.$message", $matches); // allows {$name} in subject or message + preg_match_all('~\\{\\$([a-z0-9_]+)\\}~i', "$subject.$message", $matches); // allows {$name} in subject or message $rows = get_rows("SELECT DISTINCT $field" . ($matches[1] ? ", " . implode(", ", array_map('idf_escape', array_unique($matches[1]))) : "") . " FROM " . table($_GET["select"]) . " WHERE $field IS NOT NULL AND $field != ''" . ($where ? " AND " . implode(" AND ", $where) : "") @@ -488,7 +488,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5 return "$function()"; } $return = $value; - if (preg_match('~date|timestamp~', $field["type"]) && preg_match('(^' . str_replace('\\$1', '(?P\\d*)', preg_replace('~(\\\\\\$('#' + [2-6]))~', '(?P\\d{1,2})', preg_quote(lang('$1-$3-$5')))) . '(.*))', $value, $match)) { + if (preg_match('~date|timestamp~', $field["type"]) && preg_match('(^' . str_replace('\\$1', '(?P\\d*)', preg_replace('~(\\\\\\$([2-6]))~', '(?P\\d{1,2})', preg_quote(lang('$1-$3-$5')))) . '(.*))', $value, $match)) { $return = ($match["p1"] != "" ? $match["p1"] : ($match["p2"] != "" ? ($match["p2"] < 70 ? 20 : 19) . $match["p2"] : gmdate("Y"))) . "-$match[p3]$match[p4]-$match[p5]$match[p6]" . end($match); } $return = ($field["type"] == "bit" && preg_match('~^[0-9]+$~', $value) ? $return : q($return));