r105333 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105332‎ | r105333 | r105334 >
Date:18:52, 6 December 2011
Author:demon
Status:ok
Tags:
Comment:
More empty removals
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -622,7 +622,7 @@
623623 $wgRequest->response()->setcookie( 'mfsecure', '1', 0, '' );
624624 } else {
625625 $mfSecure = $wgRequest->getCookie( 'mfsecure', '' );
626 - if ( !empty( $mfSecure ) && $mfSecure == '1' ) {
 626+ if ( $mfSecure && $mfSecure == '1' ) {
627627 $wgRequest->response()->setcookie( 'mfsecure', '', 0, '' );
628628 }
629629 }
@@ -729,7 +729,7 @@
730730 private function sendXDeviceVaryHeader() {
731731 global $wgOut, $wgRequest;
732732 wfProfileIn( __METHOD__ );
733 - if ( !empty( $_SERVER['HTTP_X_DEVICE'] ) ) {
 733+ if ( isset( $_SERVER['HTTP_X_DEVICE'] ) ) {
734734 $wgRequest->response()->header( 'X-Device: ' . $_SERVER['HTTP_X_DEVICE'] );
735735 $wgOut->addVaryHeader( 'X-Device' );
736736 }
@@ -741,11 +741,11 @@
742742 private function sendApplicationVersionVaryHeader() {
743743 global $wgOut, $wgRequest;
744744 wfProfileIn( __METHOD__ );
745 - if ( !empty( $_SERVER['HTTP_APPLICATION_VERSION'] ) ) {
 745+ if ( isset( $_SERVER['HTTP_APPLICATION_VERSION'] ) ) {
746746 $wgRequest->response()->header( 'Application_Version: ' . $_SERVER['HTTP_APPLICATION_VERSION'] );
747747 $wgOut->addVaryHeader( 'Application_Version' );
748748 } else {
749 - if ( !empty( $_SERVER['HTTP_X_DEVICE'] ) ) {
 749+ if ( isset( $_SERVER['HTTP_X_DEVICE'] ) ) {
750750 if ( stripos( $_SERVER['HTTP_X_DEVICE'], 'iphone' ) !== false ||
751751 stripos( $_SERVER['HTTP_X_DEVICE'], 'android' ) !== false ) {
752752 $wgRequest->response()->header( 'Application_Version: ' . $_SERVER['HTTP_X_DEVICE'] );

Follow-up revisions

RevisionCommit summaryAuthorDate
r1053371.18wmf1: MFT r105206 - r105333preilly19:28, 6 December 2011

Status & tagging log