From 3fec3b45268196ea2eec69c7556c81f4003dfacf Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 17 Sep 2006 18:31:48 +0000 Subject: [PATCH] r1163: Actually do the regex match on process_custom_fields() --- docs/changes.txt | 1 + includes/functions.php | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 31005ef..d663fce 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -8,6 +8,7 @@ - More changes to syndicate.php to increase performance - Add checks to newreport.php and search.php to see if there are products or versions, if there aren't, then throw a message about needing them to be setup - Process custom field data on newreport.php +- Add regex matching check to process_custom_fields() 1.1.0 Beta 2 =============================== diff --git a/includes/functions.php b/includes/functions.php index 03a12be..559b7a6 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -382,6 +382,15 @@ function process_custom_fields($bugid, $msg, $errorbox = false, $inputdata = arr continue; } + if (!empty($field['regexmatch'])) + { + if (!preg_match('#' . str_replace('#', '\#', $field['regexmatch']) . '#si', $inputdata["field$field[fieldid]"])) + { + $errorlist[] = sprintf(_('%1$s does not match the specified format'), $field['name']); + continue; + } + } + if (isset($inputdata["field$field[fieldid]"])) { $fieldbuild[] = 'field' . $field['fieldid']; -- 2.43.5