Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

syntax fix for MDL-14678

  • Loading branch information...
commit f35e2e78bd67f304f8c2a0627d5ffd43b4c3cbc5 1 parent a3f5733
diml authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 search/documents/physical_xml.php
View
8 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);
Please sign in to comment.
Something went wrong with that request. Please try again.