Permalink
Browse files

syntax fix for MSL-14678

  • Loading branch information...
diml
diml committed May 4, 2008
1 parent 2841152 commit bb6c0ef2cfd506c291fc699a21af347bcbd23ef4
Showing with 6 additions and 2 deletions.
  1. +6 −2 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);

0 comments on commit bb6c0ef

Please sign in to comment.