From 22ca7474ea2e597c0ddf726e728298da6e942db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dark=E2=9D=B6?= Date: Fri, 19 Apr 2019 19:06:40 +0530 Subject: [ticket/16021] Recognize number of Template Event instances in events.md file PHPBB3-16021 --- phpBB/docs/events.md | 12 ++++++------ phpBB/phpbb/event/md_exporter.php | 13 ++++++++++--- 2 files changed, 16 insertions(+), 9 deletions(-) (limited to 'phpBB') diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index fb782ee452..d07023cd4e 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1740,14 +1740,14 @@ posting_attach_body_file_list_after * Locations: + styles/prosilver/template/posting_attach_body.html * Since: 3.2.6-RC1 -* Purpose: Add content after attachments list +* Purpose: Add content after attachments list posting_attach_body_file_list_before === * Locations: + styles/prosilver/template/posting_attach_body.html * Since: 3.2.6-RC1 -* Purpose: Add content before attachments list +* Purpose: Add content before attachments list posting_editor_add_panel_tab === @@ -2102,14 +2102,14 @@ search_results_header_before search_results_last_post_author_username_append === * Locations: - + styles/prosilver/template/search_results.html + + styles/prosilver/template/search_results.html (2) * Since: 3.2.4-RC1 * Purpose: Append information to last post author username of member search_results_last_post_author_username_prepend === * Locations: - + styles/prosilver/template/search_results.html + + styles/prosilver/template/search_results.html (2) * Since: 3.2.4-RC1 * Purpose: Prepend information to last post author username of member @@ -2612,14 +2612,14 @@ ucp_register_profile_fields_before viewforum_body_last_post_author_username_append === * Locations: - + styles/prosilver/template/viewforum_body.html + + styles/prosilver/template/viewforum_body.html (2) * Since: 3.2.4-RC1 * Purpose: Append information to last post author username of member viewforum_body_last_post_author_username_prepend === * Locations: - + styles/prosilver/template/viewforum_body.html + + styles/prosilver/template/viewforum_body.html (2) * Since: 3.2.4-RC1 * Purpose: Prepend information to last post author username of member 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; -- cgit v1.2.1 From f2489a4c002538a986580008f959f5450cbc0b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dark=E2=9D=B6?= Date: Fri, 19 Apr 2019 21:57:23 +0530 Subject: [ticket/16021] Recognize number of Template Event instances in events.md file PHPBB3-16021 --- phpBB/phpbb/event/md_exporter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB') diff --git a/phpBB/phpbb/event/md_exporter.php b/phpBB/phpbb/event/md_exporter.php index 1f7e59b1e9..1a2d7c989e 100644 --- a/phpBB/phpbb/event/md_exporter.php +++ b/phpBB/phpbb/event/md_exporter.php @@ -394,7 +394,7 @@ class md_exporter throw new \LogicException("Invalid event instances for file '{$file}' found for event '{$this->current_event}'", 1); } - list($file, ) = explode(" ", $file); + list($file) = explode(" ", $file); if (!file_exists($this->path . $file) || substr($file, -5) !== '.html') { -- cgit v1.2.1