Replace the call to action=raw with a couple API calls for the main
[lhc/web/wiklou.git] / maintenance / fuzz-tester.php
index 4e90d52..1248570 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 /**
-* @addtogroup Maintenance
+* @file
+* @ingroup Maintenance
 * @author Nick Jenkins ( http://nickj.org/ ).
 * @copyright 2006 Nick Jenkins
 * @licence GNU General Public Licence 2.0
@@ -168,7 +169,7 @@ TODO:
 /////////////////////////// COMMAND LINE HELP ////////////////////////////////////
 
 // This is a command line script, load MediaWiki env (gives command line options);
-include('commandLine.inc');
+require('commandLine.inc');
 
 // if the user asked for an explanation of command line options.
 if ( isset( $options["help"] ) ) {
@@ -545,6 +546,8 @@ class wikiFuzz {
             "Image:",
             "[[:Image",
             'px',
+            'upright=',
+            'border',
 
             // misc stuff to throw at the Parser.
             '%08X',
@@ -621,7 +624,7 @@ class wikiFuzz {
             "{{ns:0}}",
             "{{fullurle:",
             "}}",
-            "{{subst:",
+            "{{subst::",
             "}}",
             "{{UCFIRST:",
             "}}",
@@ -1316,7 +1319,7 @@ class viewPageTest extends pageTest {
                         "li", "lo", "lt", "lv", "mk", "ml", "ms", "nah", "nap", "nds", 
                         "nds-nl", "nl", "nn", "no", "non", "nv", "oc", "or", "os", "pa", 
                         "pl", "pms", "ps", "pt", "pt-br", "qu", "rmy", "ro", "ru", "sc", 
-                        "sd", "sk", "sl", "sq", "sr", "sr-ec", "sr-el", "sr-jc", "sr-jl", 
+                        "sd", "sk", "sl", "sq", "sr", "sr-ec", "sr-el",
                         "su", "sv", "ta", "te", "th", "tlh", "tr", "tt", "ty", "tyv", "udm", 
                         "ug", "uk", "ur", "utf8", "vec", "vi", "wa", "xal", "yi", "za", 
                         "zh", "zh-cn", "zh-hk", "zh-sg", "zh-tw", "zh-tw") ),
@@ -2165,23 +2168,23 @@ class api extends pageTest {
  */
 class GeSHi_Test extends pageTest {
        
-       private function getGeSHiContent()       {
-               return "<source lang=\"" . $this->getLang() . "\" "
-                      . (wikiFuzz::randnum(2) == 0 ? "line " : "")
-                      . (wikiFuzz::randnum(2) == 0 ? "strict " : "")
-                          . "start=" . wikiFuzz::chooseInput( array(wikiFuzz::randnum(-6000,6000), wikifuzz::makeFuzz(2)) )
-                          . ">"
-                      . wikiFuzz::makeFuzz(2)
-                      . "</source>";
-       }
+    private function getGeSHiContent() {
+        return "<source lang=\"" . $this->getLang() . "\" "
+               . (wikiFuzz::randnum(2) == 0 ? "line " : "")
+               . (wikiFuzz::randnum(2) == 0 ? "strict " : "")
+               . "start=" . wikiFuzz::chooseInput( array(wikiFuzz::randnum(-6000,6000), wikifuzz::makeFuzz(2)) )
+               . ">"
+               . wikiFuzz::makeFuzz(2)
+               . "</source>";
+    }
        
-       private function getLang() {
-               return wikiFuzz::chooseInput( array( "actionscript", "ada", "apache", "applescript", "asm", "asp", "autoit", "bash", "blitzbasic", "bnf", "c", "c_mac", "caddcl", "cadlisp", "cfdg", "cfm", "cpp", "cpp-qt", 
-               "csharp", "css", "d", "delphi", "diff", "div", "dos", "eiffel", "fortran", "freebasic", "gml", "groovy", "html4strict", "idl", "ini", "inno", "io", "java", "java5",
-               "javascript", "latex", "lisp", "lua", "matlab", "mirc", "mpasm", "mysql", "nsis", "objc", "ocaml", "ocaml-brief", "oobas", "oracle8", "pascal", "perl", "php",
-               "php-brief", "plsql", "python", "qbasic", "rails", "reg", "robots", "ruby", "sas", "scheme", "sdlbasic", "smalltalk", "smarty", "sql", "tcl", "text", "thinbasic",
-               "tsql", "vb", "vbnet", "vhdl", "visualfoxpro", "winbatch", "xml", "xpp", "z80", wikifuzz::makeFuzz(1) ) );
-       }
+    private function getLang() {
+       return wikiFuzz::chooseInput( array( "actionscript", "ada", "apache", "applescript", "asm", "asp", "autoit", "bash", "blitzbasic", "bnf", "c", "c_mac", "caddcl", "cadlisp",
+                "cfdg", "cfm", "cpp", "cpp-qt", "csharp", "css", "d", "delphi", "diff", "div", "dos", "eiffel", "fortran", "freebasic", "gml", "groovy", "html4strict", "idl", 
+                "ini", "inno", "io", "java", "java5", "javascript", "latex", "lisp", "lua", "matlab", "mirc", "mpasm", "mysql", "nsis", "objc", "ocaml", "ocaml-brief", "oobas",
+                "oracle8", "pascal", "perl", "php", "php-brief", "plsql", "python", "qbasic", "rails", "reg", "robots", "ruby", "sas", "scheme", "sdlbasic", "smalltalk", "smarty",
+                "sql", "tcl", "text", "thinbasic", "tsql", "vb", "vbnet", "vhdl", "visualfoxpro", "winbatch", "xml", "xpp", "z80", wikifuzz::makeFuzz(1) ) );
+    }
        
     function __construct() {
         $this->pagePath = "index.php?title=WIKIFUZZ";
@@ -2444,7 +2447,7 @@ function validateHTML($text) {
     if (curl_error($ch)) {
         trigger_error("Curl error #: " . curl_errno($ch) . " - " . curl_error ($ch) );
         print "Curl error #: " . curl_errno($ch) . " - " . curl_error ($ch) . " - exiting.\n";
-        exit();
+        exit(1);
     }
 
     curl_close ($ch);
@@ -2744,4 +2747,4 @@ for ($count=0; true; $count++) {
     }
 }
 
-?>
+