[Fusionforge-commits] r13474 - branches/Branch_5_1/src/common/docman/engine

Alain Peyrat aljeux at fusionforge.org
Fri Jun 10 12:05:48 CEST 2011


Author: aljeux
Date: 2011-06-10 12:05:48 +0200 (Fri, 10 Jun 2011)
New Revision: 13474

Modified:
   branches/Branch_5_1/src/common/docman/engine/parser_text.inc.php
Log:
Protect code if php mb_strtolower is not available.

Modified: branches/Branch_5_1/src/common/docman/engine/parser_text.inc.php
===================================================================
--- branches/Branch_5_1/src/common/docman/engine/parser_text.inc.php	2011-06-10 10:05:45 UTC (rev 13473)
+++ branches/Branch_5_1/src/common/docman/engine/parser_text.inc.php	2011-06-10 10:05:48 UTC (rev 13474)
@@ -32,9 +32,15 @@
 	$fp = fopen($fichin, "r");
 	$buff = fread($fp, filesize($fichin));
 	// tout en minuscules
-	$buff = mb_strtolower($buff);
+	if (function_exists('mb_strtolower')) {
+		$buff = mb_strtolower($buff);
+	} else {
+		$buff = strtolower($buff);
+	}
 	// élimination d'éventuels caractères unicode encore présents
-	$buff = mb_convert_encoding($buff, "ascii");
+	if (function_exists('mb_convert_encoding')) {
+		$buff = mb_convert_encoding($buff, "ascii");
+	}
 	// élimination caractères avec accents 
 	// et caractères spéciaux
 	$buff = suppression_diacritics($buff);




More information about the Fusionforge-commits mailing list