From a087c03c02dc4536e807ea4c2d26050ff71de667 Mon Sep 17 00:00:00 2001 From: skodak Date: Sat, 3 May 2008 21:43:36 +0000 Subject: [PATCH] MDL-14678 syntax problems --- search/documents/physical_xml.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); -- 2.39.5