Skip to content

Commit

Permalink
ouwiki: PHP fatal error on allowed memory exhausted #95555
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-platts authored and sammarshallou committed Sep 22, 2015
1 parent f0aa01e commit 0a5f2c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
15 changes: 3 additions & 12 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3427,12 +3427,8 @@ function ouwiki_build_tree(&$index) {
}

function ouwiki_has_subwikis($ouwikiid) {
$rs = ouwiki_get_subwikis($ouwikiid);
if (!empty($rs)) {
return true;
} else {
return false;
}
global $DB;
return $DB->record_exists('ouwiki_subwikis', array('wikiid' => $ouwikiid));
}

function ouwiki_get_subwikis($wikiid) {
Expand All @@ -3443,12 +3439,7 @@ function ouwiki_get_subwikis($wikiid) {

function ouwiki_subwiki_content_exists($subwikiid) {
global $DB;
$rs = $DB->get_records_select('ouwiki_pages', 'subwikiid = ? AND currentversionid IS NOT null', array($subwikiid));
if (!empty($rs)) {
return true;
} else {
return false;
}
return $DB->record_exists_select('ouwiki_pages', 'subwikiid = ? AND currentversionid IS NOT null', array($subwikiid));
}

function ouwiki_get_wiki_details($version) {
Expand Down
2 changes: 2 additions & 0 deletions wikiindex.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
require_once(dirname(__FILE__) . '/../../config.php');
require($CFG->dirroot.'/mod/ouwiki/basicpage.php');

raise_memory_limit(MEMORY_EXTRA);

$treemode = optional_param('type', '', PARAM_ALPHA) == 'tree';
$id = required_param('id', PARAM_INT); // Course Module ID

Expand Down

0 comments on commit 0a5f2c1

Please sign in to comment.