Commit 251b026f authored by Ghada El-Zoghbi's avatar Ghada El-Zoghbi Committed by Robert Lyon
Browse files

Bug 1832803: Check for empty string before passing it to DOMDocument

If an empty string is passed to the DOMDocument, a warning is
generated. Avoid the warning by checking for an empty string.

Sponsored by The Australian National University


Change-Id: I4bd3982de81f6db97601a1dbe5232d344e87ca81
parent c40945d8
......@@ -1172,12 +1172,15 @@ class ArtefactTypeComment extends ArtefactType {
* Removes the classes from the text of the comment thst could interfere
* Removes the classes from the text of the comment that could interfere
* with the comment display
* @param string $comment the text content of the comment
public static function remove_comments_classes($comment) {
if (empty($comment)) {
return "";
$dom = new DOMDocument();
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment