diff options
| author | Tristan Darricau <tristan.darricau@gmail.com> | 2018-07-08 18:14:20 +0200 |
|---|---|---|
| committer | Tristan Darricau <tristan.darricau@gmail.com> | 2018-07-08 18:14:20 +0200 |
| commit | 55420701697bac736ab7d50d5427d48c1041e2ff (patch) | |
| tree | fff47f96c99a8f2dbe91d6d4cb7d4f7d167e5cd3 /phpBB/phpbb | |
| parent | 777443d95c3fbbfb9fce942f3fd5fad397f610ea (diff) | |
| parent | eedcb3bbe14c6745c10a959da31657f36d8914c3 (diff) | |
| download | forums-55420701697bac736ab7d50d5427d48c1041e2ff.tar forums-55420701697bac736ab7d50d5427d48c1041e2ff.tar.gz forums-55420701697bac736ab7d50d5427d48c1041e2ff.tar.bz2 forums-55420701697bac736ab7d50d5427d48c1041e2ff.tar.xz forums-55420701697bac736ab7d50d5427d48c1041e2ff.zip | |
Merge pull request #5198 from kasimi/ticket/15637
[ticket/15637] Extract multi-line PHP event descriptions
* github.com:/phpbb/phpbb:
[ticket/15637] Remove trailing space from description
[ticket/15637] Preserve line breaks in event descriptions
[ticket/15637] Updated test fixture to include complete event description
[ticket/15637] Remove trailing space from description
[ticket/15637] Fixed removing white-spaces from description line
[ticket/15637] Extract all lines before the first @tag
[ticket/15637] Extract multi-line PHP event descriptions
Diffstat (limited to 'phpBB/phpbb')
| -rw-r--r-- | phpBB/phpbb/event/php_exporter.php | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/phpBB/phpbb/event/php_exporter.php b/phpBB/phpbb/event/php_exporter.php index 64d1e429b7..71c94a681d 100644 --- a/phpBB/phpbb/event/php_exporter.php +++ b/phpBB/phpbb/event/php_exporter.php @@ -264,7 +264,30 @@ class php_exporter // Find event description line $description_line_num = $this->find_description(); - $description = substr(trim($this->file_lines[$description_line_num]), strlen('* ')); + $description_lines = array(); + + while (true) + { + $description_line = substr(trim($this->file_lines[$description_line_num]), strlen('*')); + $description_line = trim(str_replace("\t", " ", $description_line)); + + // Reached end of description if line is a tag + if (strlen($description_line) && $description_line[0] == '@') + { + break; + } + + $description_lines[] = $description_line; + $description_line_num++; + } + + // If there is an empty line between description and first tag, remove it + if (!strlen(end($description_lines))) + { + array_pop($description_lines); + } + + $description = trim(implode('<br/>', $description_lines)); if (isset($this->events[$this->current_event])) { |
