GeezerVison is showing static-codereview.wikimedia.org — r82156 MediaWiki - Code Review archive
r82156 MediaWiki - Code Review archive
| Repository: | MediaWiki |
| Revision: | < r82155 | r82156 | r82157 > |
| Date: | 00:49, 15 February 2011 |
| Author: | tparscal |
| Status: | ok |
| Tags: | |
| Comment: | Resolves remaining issues in r82000 with remapping relative CSS URLs that contained queries. |
| Modified paths: |
- /trunk/phase3/includes/libs/CSSMin.php (modified) (history)
|
| Index: trunk/phase3/includes/libs/CSSMin.php |
| — | — | @@ -36,7 +36,7 @@ |
| 37 | 37 | * which when base64 encoded will result in a 1/3 increase in size. |
| 38 | 38 | */ |
| 39 | 39 | const EMBED_SIZE_LIMIT = 24576; |
| 40 | | - const URL_REGEX = 'url\(\s*[\'"]?(?P<file>[^\?\)\'"]*)\??[^\)\'"]*[\'"]?\s*\)'; |
| | 40 | + const URL_REGEX = 'url\(\s*[\'"]?(?P<file>[^\?\)\'"]*)(?P<query>\??[^\)\'"]*)[\'"]?\s*\)'; |
| 41 | 41 | |
| 42 | 42 | /* Protected Static Members */ |
| 43 | 43 | |
| — | — | @@ -130,6 +130,7 @@ |
| 131 | 131 | $embed = $match['embed'][0]; |
| 132 | 132 | $pre = $match['pre'][0]; |
| 133 | 133 | $post = $match['post'][0]; |
| | 134 | + $query = $match['query'][0]; |
| 134 | 135 | $url = "{$remote}/{$match['file'][0]}"; |
| 135 | 136 | $file = "{$local}/{$match['file'][0]}"; |
| 136 | 137 | $replacement = false; |
| — | — | @@ -163,7 +164,7 @@ |
| 164 | 165 | } |
| 165 | 166 | } else if ( $local === false ) { |
| 166 | 167 | // Assume that all paths are relative to $remote, and make them absolute |
| 167 | | - $replacement = "{$embed}{$pre}url({$url}){$post};"; |
| | 168 | + $replacement = "{$embed}{$pre}url({$url}{$query}){$post};"; |
| 168 | 169 | } |
| 169 | 170 | if ( $replacement !== false ) { |
| 170 | 171 | // Perform replacement on the source |
Follow-up revisions
| Revision | Commit summary | Author | Date |
|---|
| r82218 | Followup r82156: skip relative URLs with absolute paths too | catrope | 06:27, 16 February 2011 |
| r82220 | 1.17wmf1: MFT r80495, r80765, r81177, r82000, r82155, r82156, r82191, r82200,... | catrope | 07:23, 16 February 2011 |
| r85151 | MFT: r82000, r82004, r82020, r82025, r82038, r82039, r82048, r82070, r82081, ... | demon | 20:39, 1 April 2011 |
Past revisions this follows-up on
| Revision | Commit summary | Author | Date |
|---|
| r82000 | Resolves bug #27328 by supporting URL rewriting for CSS that comes from the W... | tparscal | 22:57, 11 February 2011 |
Status & tagging log
- 17:06, 7 April 2011 Trevor Parscal (WMF) (talk | contribs) changed the tags for r82156 [removed: roan]
- 20:40, 1 April 2011 😂 (talk | contribs) changed the tags for r82156 [removed: 1.17]
- 07:24, 16 February 2011 Catrope (talk | contribs) changed the tags for r82156 [removed: 1.17wmf1]
- 07:23, 16 February 2011 Catrope (talk | contribs) changed the tags for r82156 [added: 1.17]
- 07:23, 16 February 2011 Catrope (talk | contribs) changed the tags for r82156 [removed: 1.17]
- 06:28, 16 February 2011 Catrope (talk | contribs) changed the tags for r82156 [added: 1.17]
- 06:28, 16 February 2011 Catrope (talk | contribs) changed the status of r82156 [removed: new added: ok]
- 22:07, 15 February 2011 Trevor Parscal (WMF) (talk | contribs) changed the tags for r82156 [removed: 1.17wm1 added: 1.17wmf1]
- 22:07, 15 February 2011 Trevor Parscal (WMF) (talk | contribs) changed the tags for r82156 [added: 1.17wm1]
- 22:07, 15 February 2011 Trevor Parscal (WMF) (talk | contribs) changed the tags for r82156 [removed: 1.17]
- 22:06, 15 February 2011 Trevor Parscal (WMF) (talk | contribs) changed the tags for r82156 [added: roan,1.17]
|