Commit a04e77f9 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add more checks when retrieving latest Mahara version (see bug #638511)

Check that download page was retrieved from launchpad
Suppress warnings & errors when parsing html from the download page
Signed-off-by: default avatarRichard Mansfield <>
parent e0c34bf7
......@@ -2370,8 +2370,19 @@ function cron_check_for_updates() {
$result = mahara_http_request($request);
if (!empty($result->errno)) {
log_debug('Could not retrieve launchpad download page');
$page = new DOMDocument();
$success = $page->loadHTML($result->data);
if (!$success) {
log_debug('Error parsing launchpad download page');
$xpath = new DOMXPath($page);
$query = '//div[starts-with(@id,"release-information-")]';
$elements = $xpath->query($query);
Supports Markdown
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