[Fusionforge-commits] r7763 - branches/Branch_4_8/gforge/common/search

Guillaume Smet gsmet at libremir.placard.fr.eu.org
Sun Jun 7 20:12:02 CEST 2009


Author: gsmet
Date: 2009-06-07 20:12:01 +0200 (Sun, 07 Jun 2009)
New Revision: 7763

Modified:
   branches/Branch_4_8/gforge/common/search/SearchQuery.class.php
Log:
fixed the search engine so that we can find projects which have an underscore in their names
http://archives.postgresql.org/pgsql-www/2009-06/msg00051.php

Modified: branches/Branch_4_8/gforge/common/search/SearchQuery.class.php
===================================================================
--- branches/Branch_4_8/gforge/common/search/SearchQuery.class.php	2009-06-07 17:55:20 UTC (rev 7762)
+++ branches/Branch_4_8/gforge/common/search/SearchQuery.class.php	2009-06-07 18:12:01 UTC (rev 7763)
@@ -114,13 +114,13 @@
 		if(is_numeric($words) && $this->implementsSearchById()) {
 			$this->searchId = (int) $words;
 		} else {
-			$words = htmlspecialchars($words);
-			$words = strtr($words, array('%' => '', '_' => ''));
 			$words = preg_replace("/[ \t]+/", ' ', $words);
 			if(strlen($words) < 3) {
 				$this->setError(_('Error: search query too short'));
 				return;
 			}
+			$words = htmlspecialchars($words);
+			$words = strtr($words, array('%' => '\%', '_' => '\_'));
 			$this->words = array();
 			$this->phrases = array();
 			$phrase = '';




More information about the Fusionforge-commits mailing list