From: diml Date: Mon, 7 Apr 2008 19:56:44 +0000 (+0000) Subject: fixes HTM files parsing X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e1778c0c5ea90c15ceadeab175742977bf135a63;p=moodle.git fixes HTM files parsing --- diff --git a/search/documents/physical_htm.php b/search/documents/physical_htm.php index b336443ea9..90b8c0100e 100644 --- a/search/documents/physical_htm.php +++ b/search/documents/physical_htm.php @@ -24,16 +24,16 @@ function get_text_for_indexing_htm(&$resource){ if (!isadmin($USER->id)) return; // just get text - $text = implode('', file("{$CFG->dataroot}/{$resource->course}/($resource->reference)")); + $text = implode('', file("{$CFG->dataroot}/{$resource->course}/{$resource->reference}")); // extract keywords and other interesting meta information and put it back as real content for indexing - if (preg_match('/(.*)]*)>(.*)/is',$text, $matches)){ + if (preg_match('/(.*)]*)>(.*)/is', $text, $matches)){ $prefix = $matches[1]; $meta_attributes = $matches[2]; $suffix = $matches[3]; - if (preg_match('/name="(keywords|description)"/i', $attributes)){ - preg_match('/content="[^"]+"/i', $attributes, $matches); - $text = $prefix.' '.$matches[1].' '.$suffix; + if (preg_match('/name="(keywords|description)"/i', $meta_attributes)){ + preg_match('/content="[^"]+"/i', $meta_attributes, $matches); + $text = $prefix.' '.$matches[0].' '.$suffix; } } // filter all html tags