Skip to content

Commit

Permalink
syntax fix for MDL-14678
Browse files Browse the repository at this point in the history
  • Loading branch information
diml committed May 4, 2008
1 parent a3f5733 commit f35e2e7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions search/documents/physical_xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f35e2e7

Please sign in to comment.