Reviewed: https://reviews.mahara.org/10083 Committed: https://git.mahara.org/mahara/mahara/commit/0283745692d9e23991fda19f52ecb410226f7603 Submitter: Robert Lyon ([email protected]) Branch: 18.04_STABLE
commit 0283745692d9e23991fda19f52ecb410226f7603 Author: Ghada El-Zoghbi <[email protected]> Date: Fri Jun 14 14:53:11 2019 +1000 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 behatnotneeded Change-Id: I4bd3982de81f6db97601a1dbe5232d344e87ca81 -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it! https://bugs.launchpad.net/bugs/1832803 Title: Adding an empty string as a comment generates a warning Status in Mahara: In Progress Status in Mahara 18.04 series: Fix Committed Status in Mahara 18.10 series: Fix Committed Status in Mahara 19.04 series: Fix Committed Status in Mahara 19.10 series: In Progress Bug description: Mahara: 19.04.0 OS: Linux 16.04 DB: Postgres Browser: FF When entering a comment which does not have any text but includes an uploaded file, the following warning is generated: [WAR] bd (artefact/comment/lib.php:1184) DOMDocument::loadHTML(): Empty string supplied as input Call stack (most recent first): log_message("DOMDocument::loadHTML(): Empty string supplied as ...", 8, true, true, "/var/www/mahara/htdocs/artefact/commen...", 1184) at /var/www/mahara/htdocs/lib/errors.php:520 error(2, "DOMDocument::loadHTML(): Empty string supplied as ...", "/var/www/mahara/htdocs/artefact/commen...", 1184, array(size 2)) at Unknown:0 DOMDocument->loadHTML("", 8196) at /var/www/mahara/htdocs/artefact/comment/lib.php:1184 ArtefactTypeComment::remove_comments_classes("") at /var/www/mahara/htdocs/artefact/comment/lib.php:1637 add_feedback_form_submit(object(Pieform), array(size 8)) at /var/www/mahara/htdocs/lib/pieforms/pieform.php:544 Pieform->__construct(array(size 9)) at /var/www/mahara/htdocs/lib/pieforms/pieform.php:166 Pieform::process(array(size 9)) at /var/www/mahara/htdocs/lib/mahara.php:5400 pieform(array(size 9)) at /var/www/mahara/htdocs/view/view.php:266 To reproduce: * Create a view with a comment section * View the page and enter a comment * Upload a file for the comment and leave the content empty. * Save * Refresh page * The above warning appears Expected: no warning should appear. To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1832803/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~mahara-contributors Post to : [email protected] Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp

