r96287 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96286‎ | r96287 | r96288 >
Date:16:15, 5 September 2011
Author:catrope
Status:ok
Tags:
Comment:
Make the evil InitialiseSettings.php parser in lsearch look for wgCanonicalServer rather than wgServer due to issues caused by protocol-relative URLs
Modified paths:
  • /trunk/lucene-search-2/src/org/wikimedia/lsearch/util/PHPParser.java (modified) (history)

Diff [purge]

Index: trunk/lucene-search-2/src/org/wikimedia/lsearch/util/PHPParser.java
@@ -170,13 +170,13 @@
171171 return langs;
172172 }
173173
174 - /** Get wgServer from InitialiseSettings */
 174+ /** Get wgCanonicalServer from InitialiseSettings */
175175 public Hashtable<String,String> getServer(String text){
176176 text = text.replaceAll("(#.*)",""); // strip comments
177177 Hashtable<String,String> servers = new Hashtable<String,String>();
178178
179179 int flags = Pattern.CASE_INSENSITIVE | Pattern.DOTALL;
180 - Pattern wgserv = Pattern.compile("[\"']wgServer[\"']\\s*=>\\s*array\\s*\\((.*?)\\)",flags);
 180+ Pattern wgserv = Pattern.compile("[\"']wgCanonicalServer[\"']\\s*=>\\s*array\\s*\\((.*?)\\)",flags);
181181 Pattern entry = Pattern.compile("[\"'](.*?)[\"']\\s*=>\\s*[\"'](.*?)[\"']",flags);
182182 Matcher matcher = wgserv.matcher(text);
183183 while(matcher.find()){

Status & tagging log