5 # Scan for old exit_error syntax (second argument is not a tab name)
6 sub scan_exit_error ($) {
7 local $content = shift;
10 while ($content =~ /exit_error\s*\((.*?),([^,]*?)\s*\)\s*;(.*)/s) {
12 ($match = $2) =~ s/\s+/ /;
13 $match =~ s/^'(.*)'$/\1/;
14 push(@matches, $match) if ($match !~ /^(admin|home|my|frs|tracker|docman|forums|news|mail|pm|scm|trove|surveys|summary|)$/);
17 $k = "exit_error>".$File::Find::name.": ";
18 print $k.join("\n$k", @matches)."\n" if (@matches);
21 # Scan for getStringFromRequest used for *_id vars, should be getIntFromRequest intead.
22 sub scan_getStringFromRequest ($) {
23 local $content = shift;
26 while ($content =~ /(getStringFromRequest\s*\('[^']*?_id'\))\s*;(.*)/s) {
31 $k = "getString>".$File::Find::name.": ";
32 print $k.join("\n$k", @matches)."\n" if (@matches);
35 # Scan for deprecated func in code.
36 sub scan_deprecated_func ($) {
37 local $content = shift;
40 while ($content =~ /(eregi?\s*\(.*?\))(.*)/) {
45 $k = "ereg(i)>".$File::Find::name.": ";
46 print $k.join("\n$k", @matches)."\n" if (@matches);
52 $content = join('', <F>);
55 scan_exit_error($content);
56 scan_getStringFromRequest($content);
57 scan_deprecated_func($content);
60 find(\&wanted, @ARGV);