diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-04-25 12:31:57 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-04-25 12:31:57 +0200 |
commit | 48278f122cf9a2b23c39eccdd998b0c9b0552b2a (patch) | |
tree | 7cf71db34c4bdefe47c4e8588c5e7b72de65a4a1 /phpBB/phpbb/event | |
parent | b32895308d13d5d9b0cd954fd8ce871a1fa073da (diff) | |
download | forums-48278f122cf9a2b23c39eccdd998b0c9b0552b2a.tar forums-48278f122cf9a2b23c39eccdd998b0c9b0552b2a.tar.gz forums-48278f122cf9a2b23c39eccdd998b0c9b0552b2a.tar.bz2 forums-48278f122cf9a2b23c39eccdd998b0c9b0552b2a.tar.xz forums-48278f122cf9a2b23c39eccdd998b0c9b0552b2a.zip |
[ticket/12273] Do not allow 3.1-A1 version
PHPBB3-12273
Diffstat (limited to 'phpBB/phpbb/event')
-rw-r--r-- | phpBB/phpbb/event/php_exporter.php | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/phpBB/phpbb/event/php_exporter.php b/phpBB/phpbb/event/php_exporter.php index 2a69f15802..ac88ffa8b5 100644 --- a/phpBB/phpbb/event/php_exporter.php +++ b/phpBB/phpbb/event/php_exporter.php @@ -544,23 +544,15 @@ class php_exporter */ public function validate_since($line) { - $since = substr(ltrim($line, "\t"), strlen('* @since ')); - - if ($since !== trim($since)) - { - throw new \LogicException("Invalid '@since' information for event " - . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 1); - } - - $since = ($since === '3.1-A1') ? '3.1.0-a1' : $since; - - if (!preg_match('#^\d+\.\d+\.\d+(?:-(?:a|b|rc|pl)\d+)?$#', $since)) + $match = array(); + preg_match('#^\* @since (\d+\.\d+\.\d+(?:-(?:a|b|rc|pl)\d+)?)$#', ltrim($line, "\t"), $match); + if (!isset($match[1])) { throw new \LogicException("Invalid '@since' information for event " - . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2); + . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'"); } - return $since; + return $match[1]; } /** |