[Fusionforge-commits] r10866 - trunk/tests/scripts

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Mon Oct 4 21:13:14 CEST 2010


Author: aljeux
Date: 2010-10-04 21:13:14 +0200 (Mon, 04 Oct 2010)
New Revision: 10866

Modified:
   trunk/tests/scripts/scan_deprecated.pl
Log:
Add scan for ereg/eregi in code

Modified: trunk/tests/scripts/scan_deprecated.pl
===================================================================
--- trunk/tests/scripts/scan_deprecated.pl	2010-10-04 19:05:01 UTC (rev 10865)
+++ trunk/tests/scripts/scan_deprecated.pl	2010-10-04 19:13:14 UTC (rev 10866)
@@ -32,6 +32,20 @@
 	print $k.join("\n$k", @matches)."\n" if (@matches);	
 }
 
+# Scan for deprecated func in code.
+sub scan_deprecated_func ($) {
+	local $content = shift;
+
+	@matches = ();
+	while ($content =~ /(eregi?\s*\(.*?\))(.*)/) {
+		$content = $2;
+		push(@matches, $1);
+	}
+
+	$k = "ereg(i)>".$File::Find::name.": ";
+	print $k.join("\n$k", @matches)."\n" if (@matches);
+}
+
 sub wanted {
 	next unless /\.php$/;
 	open(F, $_);
@@ -40,6 +54,7 @@
 
 	scan_exit_error($content);
 	scan_getStringFromRequest($content);
+	scan_deprecated_func($content);
 }
 
 find(\&wanted, @ARGV);




More information about the Fusionforge-commits mailing list