From: skodak Date: Sat, 3 May 2008 21:43:36 +0000 (+0000) Subject: MDL-14678 syntax problems X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a087c03c02dc4536e807ea4c2d26050ff71de667;p=moodle.git MDL-14678 syntax problems --- diff --git a/search/documents/physical_xml.php b/search/documents/physical_xml.php index 0fde56cb06..85f9ba8f72 100644 --- a/search/documents/physical_xml.php +++ b/search/documents/physical_xml.php @@ -17,14 +17,18 @@ * @param object $resource * @uses CFG, USER */ -function get_text_for_indexing_xml(&$resource){ +function get_text_for_indexing_xml(&$resource, $directfile = ''){ global $CFG, $USER; // SECURITY : do not allow non admin execute anything on system !! if (!isadmin($USER->id)) return; // just get text - $text = implode('', file("{$CFG->dataroot}/{$resource->course}/($resource->reference)")); + if ($directfile == ''){ + $text = implode('', file("{$CFG->dataroot}/{$resource->course}/{$resource->reference}")); + } else { + $text = implode('', file("{$CFG->dataroot}/{$directfile}")); + } // filter out all xml tags $text = preg_replace("/<[^>]*>/", ' ', $text);