[Fusionforge-commits] r14677 - in trunk/src/common: include search

Alain Peyrat aljeux at fusionforge.org
Tue Oct 18 19:57:09 CEST 2011


Author: aljeux
Date: 2011-10-18 19:57:09 +0200 (Tue, 18 Oct 2011)
New Revision: 14677

Modified:
   trunk/src/common/include/User.class.php
   trunk/src/common/include/pre.php
   trunk/src/common/search/DocsAllSearchQuery.class.php
Log:
Replace deprecated php functions.

Modified: trunk/src/common/include/User.class.php
===================================================================
--- trunk/src/common/include/User.class.php	2011-10-18 17:57:04 UTC (rev 14676)
+++ trunk/src/common/include/User.class.php	2011-10-18 17:57:09 UTC (rev 14677)
@@ -312,7 +312,7 @@
 			// ...based on the email address:
 			$email_array = explode ('@', $email, 2) ;
 			$email_u = $email_array [0];
-			$l = ereg_replace('[^a-z0-9]', '', $email_u);
+			$l = preg_replace('/[^a-z0-9]/', '', $email_u);
 			$l = substr ($l, 0, 15);
 			// Is the user part of the email address okay?
 			if (account_namevalid($l)

Modified: trunk/src/common/include/pre.php
===================================================================
--- trunk/src/common/include/pre.php	2011-10-18 17:57:04 UTC (rev 14676)
+++ trunk/src/common/include/pre.php	2011-10-18 17:57:09 UTC (rev 14677)
@@ -304,7 +304,7 @@
 			if (getStringFromServer('REQUEST_URI')!='/' && $expl_pathinfo[1]!='account' && $expl_pathinfo[1]!='export' ) exit_not_logged_in();
 			// Show proj* export even if not logged in when force login
 			// If not default web project page would be broken
-			if ($expl_pathinfo[1]=='export' && !ereg("^proj", $expl_pathinfo[2])) exit_not_logged_in();
+			if ($expl_pathinfo[1]=='export' && !preg_match('/^proj/', $expl_pathinfo[2])) exit_not_logged_in();
 		}
 
 		// Insert this page view into the database

Modified: trunk/src/common/search/DocsAllSearchQuery.class.php
===================================================================
--- trunk/src/common/search/DocsAllSearchQuery.class.php	2011-10-18 17:57:04 UTC (rev 14676)
+++ trunk/src/common/search/DocsAllSearchQuery.class.php	2011-10-18 17:57:09 UTC (rev 14677)
@@ -87,19 +87,6 @@
 
 }
 
-function prepare_search_text ($text) {
-	$rep = $text;
-	$rep = utf8_decode($rep);
-	$rep = ereg_replace ("é", "e", $rep);
-	$rep = ereg_replace ("è", "e", $rep);
-	$rep = ereg_replace ("ê", "e", $rep);
-	$rep = ereg_replace ("à", "a", $rep);
-	$rep = ereg_replace ("ù", "u", $rep);
-	$rep = ereg_replace ("ç", "c", $rep);
-	$rep = ereg_replace ("é", "e", $rep);
-	$rep = strtolower ($rep);
-	return $rep;
-}
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"




More information about the Fusionforge-commits mailing list