From e1778c0c5ea90c15ceadeab175742977bf135a63 Mon Sep 17 00:00:00 2001 From: diml Date: Mon, 7 Apr 2008 19:56:44 +0000 Subject: [PATCH] fixes HTM files parsing --- search/documents/physical_htm.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 -- 2.39.5