Brion VIBBER has uploaded a new change for review.

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

Change subject: static.php should use deployed branch for invalid hashes
......................................................................

static.php should use deployed branch for invalid hashes

Files loaded via static.php with a non-standard query string
were being pulled from the most recent available branch instead
of the deployment branch.

This caused mismatched file versions between ResourceLoader and
wgExtensionAssetsPath HTTP fetches for TimedMediaHandler's ogv.js
library, since the library applies its own cache hashes in the
query string which are in a different format.

In this case, should be fixed by using deployed version as default
both when there's no query string *and* when there's a query string
that's not a 5-character md5 hash prefix.

(This should continue to provide the forward consistency protections
of a classic cache-buster query string for those files, but they
won't get the benefits of the forward/backward protection on rollback
that static.php's hash checking would provide.)

Bug: T146363
Change-Id: I95639d5e45b18f6459c2889dc2633faadedfad9b
---
M w/static.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/54/312254/1

diff --git a/w/static.php b/w/static.php
index 3694675..984deff 100644
--- a/w/static.php
+++ b/w/static.php
@@ -128,8 +128,8 @@
                return version_compare( $b, $a );
        } );
 
-       // If request has no verification hash, prefer the current wikiversion
-       if ( !$urlHash ) {
+       // If request has no or invalid verification hash, prefer the current 
wikiversion
+       if ( !$urlHash || strlen( $urlHash ) !== 5 ) {
                array_unshift( $branchDirs, $IP );
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I95639d5e45b18f6459c2889dc2633faadedfad9b
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER <br...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to