From: nfreear Date: Tue, 10 Oct 2006 10:58:29 +0000 (+0000) Subject: Fixes bug MDL-6896, "Global search block - relative form URL broken" X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=6fbe0284420e89276a58128e069c15507303af69;p=moodle.git Fixes bug MDL-6896, "Global search block - relative form URL broken" --- diff --git a/blocks/search/block_search.php b/blocks/search/block_search.php index c370ca2925..778dc6bf39 100644 --- a/blocks/search/block_search.php +++ b/blocks/search/block_search.php @@ -46,10 +46,10 @@ //basic search form $this->content->text = - '
' - . "" - . '' - . '' + '' + . '' + . '' + . '' . '
'; } else { $this->content->text = "Sorry folks, PHP 5 is needed for the new search module."; diff --git a/search/query.php b/search/query.php index 7426833d0e..fbefcfa755 100644 --- a/search/query.php +++ b/search/query.php @@ -1,6 +1,6 @@ dirroot/search/lib.php"); + $adv = new Object(); + //check for php5, but don't die yet (see line 52) if ($check = search_check_php5()) { require_once("$CFG->dirroot/search/querylib.php"); @@ -133,17 +135,18 @@ $vars = get_object_vars($adv); - foreach ($vars as $key => $value) { - $adv->$key = stripslashes(htmlentities($value)); - } //foreach - + if (isset($vars)) { + foreach ($vars as $key => $value) { + $adv->$key = stripslashes(htmlentities($value)); + } //foreach + } ?>
- -     - Advanced search + +     + Advanced search | Statistics These words must appear: - + These words must not appear: - + These words help improve rank: - + @@ -184,23 +187,23 @@ Words in title: - + Author name: - + -
+
- +
Normal search Normal search |  Statistics
@@ -230,7 +233,7 @@ print ' documents.'; if (!$sq->is_valid_index() and isadmin()) { - print "

Admin: There appears to be no index, click here to create one."; + print "

Admin: There appears to be no search index. Please create an index.

\n"; } //if print ''; @@ -243,10 +246,10 @@ search_stopwatch(); $hit_count = $sq->count(); - print "
"; + print "
"; print $hit_count." results returned for '".stripslashes($query_string)."'."; - print "
"; + print "
"; if ($hit_count > 0) { $page_links = $sq->page_numbers(); @@ -262,10 +265,10 @@ print "
    "; foreach ($hits as $listing) { - print "
  1. $listing->title
    \n" - ."".search_shorten_url($listing->url, 70)."
    \n" - ."Type: ".$listing->doctype.", score: ".round($listing->score, 3).", author: ".$listing->author."
    \n" - ."
  2. \n"; + print "
  3. $listing->title
    \n" + ."".search_shorten_url($listing->url, 70)."
    \n" + ."Type: ".$listing->doctype.", score: ".round($listing->score, 3).", author: ".$listing->author."\n" + ."
  4. \n"; } //for print "
";