Prevent :
* Strict Standards: Non-static method Title::newFromID() should not be called statically in includes/AjaxFunctions.php on line 147
[stopped AJAX watch/unwatch working for me, as I have errors being logged to the page output]
E_STRICT warnings on truncated GET input (e.g. http://192.168.0.64/wiki/index.php?action=ajax&rs=wfAjaxWatch&rsargs[]=1 , rather than http://192.168.0.64/wiki/index.php?action=ajax&rs=wfAjaxWatch&rsargs[]=1&rsargs[]=u ), prevent by specifying default $watch value of "" (which should result in an error '<err#>' response, which is probably fine).
* Strict Standards: Missing argument 2 for wfAjaxWatch() in includes/AjaxFunctions.php on line 138
* Strict Standards: Undefined variable: watch in includes/AjaxFunctions.php on line 142
E_STRICT warnings on another truncated GET input ( http://192.168.0.64/wiki/index.php?action=ajax&rs=wfAjaxWatch&rsargs= ), prevent by specifying default $pageID value of "" (which again should result in an error '<err#>' response because it's not numeric, which is probably fine).
* Strict Standards: Missing argument 1 for wfAjaxWatch() in includes/AjaxFunctions.php on line 138
E_STRICT warning on bad GET input - "rs" as array, not as a string - (e.g. http://192.168.0.64/wiki/index.php?action=ajax&rs[]= ), adding explicit cast to string:
* Strict Standards: htmlspecialchars() expects parameter 1 to be string, array given in includes/AjaxDispatcher.php on line 58
if (! in_array( $this->func_name, $wgAjaxExportList ) ) {
header( 'Status: 400 Bad Request', true, 400 );
- print "unknown function " . htmlspecialchars( $this->func_name );
+ print "unknown function " . htmlspecialchars( (string) $this->func_name );
} else {
try {
$result = call_user_func_array($this->func_name, $this->args);
* @param $watch String 'w' to watch, 'u' to unwatch
* @return String '<w#>' or '<u#>' on successful watch or unwatch, respectively, or '<err#>' on error (invalid XML in case we want to add HTML sometime)
*/
-function wfAjaxWatch($pageID, $watch) {
+function wfAjaxWatch($pageID = "", $watch = "") {
if(wfReadOnly())
return '<err#>'; // redirect to action=(un)watch, which will display the database lock message
* @access public
* @static
*/
- function newFromID( $id ) {
+ public static function newFromID( $id ) {
$fname = 'Title::newFromID';
$dbr =& wfGetDB( DB_SLAVE );
$row = $dbr->selectRow( 'page', array( 'page_namespace', 'page_title' ),