Fix BBCode::getSpoilerHeadings()

This commit is contained in:
~keith 2022-08-13 02:22:59 +00:00
parent 96a0d9d783
commit 1e7471b71e
Signed by: keith
GPG key ID: 5BEBEEAB2C73D520
2 changed files with 4 additions and 4 deletions

View file

@ -2184,9 +2184,9 @@ class BBCode
* Returns a list of the headings of "spoiler" elements * Returns a list of the headings of "spoiler" elements
* *
* @param string $text The text containing spoiler elements * @param string $text The text containing spoiler elements
* @return array The list of spoiler headings * @return string The list of spoiler headings
*/ */
public static function getSpoilerHeadings(string $text): array public static function getSpoilerHeadings(string $text): string
{ {
DI::profiler()->startRecording('rendering'); DI::profiler()->startRecording('rendering');
@ -2197,7 +2197,7 @@ class BBCode
$headings[] = BBCode::toPlaintext($item); $headings[] = BBCode::toPlaintext($item);
} }
} }
return $headings; return implode(', ', $headings);
}); });
DI::profiler()->stopRecording(); DI::profiler()->stopRecording();

View file

@ -1605,7 +1605,7 @@ class Transmitter
} else { } else {
$warnings = BBCode::getSpoilerHeadings($item['body']); $warnings = BBCode::getSpoilerHeadings($item['body']);
if ($warnings) { if ($warnings) {
$data['summary'] = implode(', ', $warnings); $data['summary'] = $warnings;
$data['keithext:summaryFromSpoilers'] = true; $data['keithext:summaryFromSpoilers'] = true;
} }
} }