HistoryAction: Consider 'feed=' and 'feed=0' as invalid feed actions
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 13 Apr 2019 22:43:14 +0000 (23:43 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Sat, 13 Apr 2019 22:43:14 +0000 (23:43 +0100)
Previously it did a PHP truthy check, which is unrelated to the
check in question and outside its responsibility to do.

The validation of the value happens inside HistoryAction::feed
and more specifically in FeedUtils::checkFeedOutput().

Also remove needless use of unicode normalization as this only
accepts exact pre-configured presets. Those presets are linked
by the sidebar and thus never considered user or otherwise
in need of any normalization.

Change-Id: Id68a753bb5a5f03f983f5b813a42e784cf91e8c9

includes/actions/HistoryAction.php

index bc1d351..fc42be4 100644 (file)
@@ -181,10 +181,9 @@ class HistoryAction extends FormlessAction {
                }
 
                // Handle atom/RSS feeds.
-               $feedType = $request->getVal( 'feed' );
-               if ( $feedType ) {
+               $feedType = $request->getRawVal( 'feed' );
+               if ( $feedType !== null ) {
                        $this->feed( $feedType );
-
                        return;
                }