aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/event
diff options
context:
space:
mode:
authorDark❶ <dark-1@users.noreply.github.com>2019-04-19 19:06:40 +0530
committerDark❶ <dark-1@users.noreply.github.com>2019-04-19 19:06:40 +0530
commit22ca7474ea2e597c0ddf726e728298da6e942db9 (patch)
tree49ad72d7e69b9283fdbb793c1b43695d5517de4a /phpBB/phpbb/event
parentf905b40ce8bb03309fd87ad32ce424aefe76acd3 (diff)
downloadforums-22ca7474ea2e597c0ddf726e728298da6e942db9.tar
forums-22ca7474ea2e597c0ddf726e728298da6e942db9.tar.gz
forums-22ca7474ea2e597c0ddf726e728298da6e942db9.tar.bz2
forums-22ca7474ea2e597c0ddf726e728298da6e942db9.tar.xz
forums-22ca7474ea2e597c0ddf726e728298da6e942db9.zip
[ticket/16021] Recognize number of Template Event instances in events.md file
PHPBB3-16021
Diffstat (limited to 'phpBB/phpbb/event')
-rw-r--r--phpBB/phpbb/event/md_exporter.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/phpBB/phpbb/event/md_exporter.php b/phpBB/phpbb/event/md_exporter.php
index c3942bd7ce..1f7e59b1e9 100644
--- a/phpBB/phpbb/event/md_exporter.php
+++ b/phpBB/phpbb/event/md_exporter.php
@@ -389,9 +389,16 @@ class md_exporter
$files = explode("\n + ", $file_details);
foreach ($files as $file)
{
+ if (!preg_match('#^([^ ]+)( \([0-9]+\))?$#', $file))
+ {
+ throw new \LogicException("Invalid event instances for file '{$file}' found for event '{$this->current_event}'", 1);
+ }
+
+ list($file, ) = explode(" ", $file);
+
if (!file_exists($this->path . $file) || substr($file, -5) !== '.html')
{
- throw new \LogicException("Invalid file '{$file}' not found for event '{$this->current_event}'", 1);
+ throw new \LogicException("Invalid file '{$file}' not found for event '{$this->current_event}'", 2);
}
if (($this->filter !== 'adm') && strpos($file, 'styles/prosilver/template/') === 0)
@@ -404,7 +411,7 @@ class md_exporter
}
else
{
- throw new \LogicException("Invalid file '{$file}' not found for event '{$this->current_event}'", 2);
+ throw new \LogicException("Invalid file '{$file}' not found for event '{$this->current_event}'", 3);
}
$this->events_by_file[$file][] = $this->current_event;
@@ -424,7 +431,7 @@ class md_exporter
}
else
{
- throw new \LogicException("Invalid file list found for event '{$this->current_event}'", 2);
+ throw new \LogicException("Invalid file list found for event '{$this->current_event}'", 1);
}
return $files_list;