AndyRussG has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/178423

Change subject: Make Special:HideBanners set a P3P header for IE
......................................................................

Make Special:HideBanners set a P3P header for IE

Change-Id: I34c8937165dcbc425d546e7538300a988b99a4f8
---
M special/SpecialHideBanners.php
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice 
refs/changes/23/178423/1

diff --git a/special/SpecialHideBanners.php b/special/SpecialHideBanners.php
index 5bce154..d550d7d 100644
--- a/special/SpecialHideBanners.php
+++ b/special/SpecialHideBanners.php
@@ -21,6 +21,7 @@
                $category = $this->getRequest()->getText( 'category', 
'fundraising' );
                $category = Banner::sanitizeRenderedCategory( $category );
                $this->setHideCookie( $category, $duration, $reason );
+               $this->setP3P();
 
                $this->getOutput()->disable();
                wfResetOutputBuffers();
@@ -53,4 +54,12 @@
                }
                setcookie( "centralnotice_hide_{$category}", json_encode( 
$value ), $exp, '/', $cookieDomain, false, false );
        }
+
+       /**
+        * Set an invalid P3P policy header to make IE accept third-party hide 
cookies.
+        */
+       protected function setP3P() {
+               $url = Title::makeTitle( NS_SPECIAL, 'HideBanners/P3P' 
)->getCanonicalURL();
+               header( "P3P: CP=\"This is not a P3P policy! See $url for more 
info.\"", true );
+       }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/178423
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I34c8937165dcbc425d546e7538300a988b99a4f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: AndyRussG <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to