MediaWiki::performAction, return 404 on nosuchaction error
authorSergio Santoro <santoro.srg@gmail.com>
Thu, 22 May 2014 22:17:23 +0000 (00:17 +0200)
committerBrian Wolff <bawolff+wn@gmail.com>
Thu, 22 May 2014 22:37:46 +0000 (22:37 +0000)
Nosuchaction error page was sending 200 as the HTTP status code,
which was misleading. Instead return 404.

Change-Id: I9b432c9e53caf0a13e9a0c798f78a7bd8a78443b

includes/Wiki.php

index eff251f..555813d 100644 (file)
@@ -434,6 +434,7 @@ class MediaWiki {
                }
 
                if ( wfRunHooks( 'UnknownAction', array( $request->getVal( 'action', 'view' ), $page ) ) ) {
+                       $output->setStatusCode( 404 );
                        $output->showErrorPage( 'nosuchaction', 'nosuchactiontext' );
                }