From: Umherirrender Date: Tue, 18 Jun 2019 19:10:39 +0000 (+0200) Subject: Return null from overwritten FormlessAction::onView X-Git-Tag: 1.34.0-rc.0~1359^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=commitdiff_plain;h=b3ac3bd8fb9aa36e68469459ce8185caebf1914c;p=lhc%2Fweb%2Fwiklou.git Return null from overwritten FormlessAction::onView The abstract class is documented to use null for doing nothing, not void Change-Id: I99f0747117f83f4f2ae554c759a8e1737e7dc8f7 --- diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index 538b0a1233..b1d5a5048e 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -142,6 +142,7 @@ class HistoryAction extends FormlessAction { /** * Print the history page for an article. + * @return string|null */ function onView() { $out = $this->getOutput(); @@ -151,7 +152,7 @@ class HistoryAction extends FormlessAction { * Allow client caching. */ if ( $out->checkLastModified( $this->page->getTouched() ) ) { - return; // Client cache fresh and headers sent, nothing more to do. + return null; // Client cache fresh and headers sent, nothing more to do. } $this->preCacheMessages(); @@ -185,7 +186,7 @@ class HistoryAction extends FormlessAction { $feedType = $request->getRawVal( 'feed' ); if ( $feedType !== null ) { $this->feed( $feedType ); - return; + return null; } $this->addHelpLink( @@ -216,7 +217,7 @@ class HistoryAction extends FormlessAction { ] ); - return; + return null; } $ts = $this->getTimestampFromRequest( $request ); @@ -300,6 +301,8 @@ class HistoryAction extends FormlessAction { $pager->getNavigationBar() ); $out->preventClickjacking( $pager->getPreventClickjacking() ); + + return null; } /** diff --git a/includes/actions/RawAction.php b/includes/actions/RawAction.php index 505c9d5dc2..3e4e61422c 100644 --- a/includes/actions/RawAction.php +++ b/includes/actions/RawAction.php @@ -50,6 +50,7 @@ class RawAction extends FormlessAction { /** * @suppress SecurityCheck-XSS Non html mime type + * @return string|null */ function onView() { $this->getOutput()->disable(); @@ -58,11 +59,11 @@ class RawAction extends FormlessAction { $config = $this->context->getConfig(); if ( !$request->checkUrlExtension() ) { - return; + return null; } if ( $this->getOutput()->checkLastModified( $this->page->getTouched() ) ) { - return; // Client cache fresh and headers sent, nothing more to do. + return null; // Client cache fresh and headers sent, nothing more to do. } $contentType = $this->getContentType(); @@ -173,6 +174,8 @@ class RawAction extends FormlessAction { } echo $text; + + return null; } /**