As reported in bug 38294, CSSJanus returns an empty string for some
input. This seems to be caused by preg_replace_callback() returning
null which, according to the PHP docs, happens "in case of error". Of
course there's no way to figure out what the error was :S
Work around this by checking for a null return value
Change-Id: I5db952bc32f73b94ac13e449d9aa1f8693602dbd
* No need to strip them from everywhere all over. This bug is only
caused by the presence of a trailing slash on $remote.
* To make sure everything still works before and after I added
unit tests for CSSMin in Ic9195614acfd, making this dependent
on that change.
Change-Id: Ia82048a328a056117afe0d653fe22f5429b21f5a
This broke the OpenLayers support in the Maps extension, as used for example on TranslateWiki.net.
The original JavaScriptMinifier's tokenizer (r83885) explicitly didn't bother looking for the exponent part because it "didn't matter" to its internal state machine; however since r83891 added a max line length that definitely is not true.
I've split out handling of hex and decimal numerals, and let the decimal numeral handling check for exponents.
PHPUnit test cases were added in r103846.
Followup r91591, r93020: patch to jsminplus to support Unicode chars and char escapes in identifiers
Fast-path check keeps runtime about the same on most scripts (eg jquery.js parsing was abround 4100ms both before and after on my test machine)
Slow-path code kicks in if plain ASCII word chars don't extend all the way to the next whitespace or punctuation char.
Using PCRE's Unicode properties magic to ensure that we're catching everything, following ECMA-262 edition 5.1 spec.
Note that identifiers using escapes don't get normalized to their UTF-8 form; this might be a nice thing to do as it saves a couple bytes, but currently there's no change made to output.
Added QUnit tests to verify that unicode letter & escapes work in identifiers in all supported browsers (ok back to IE 6, yay)
This fixes the Notices that would be produced if several JSTokenizer were instantiated.
jsminplus was added in r91591.
Defines code was generated with:
$js = new JSTokenizer();
foreach ($js->opTypeNames as $operand => $name) echo "define('OP_$name', '$operand');\n";
foreach ($js->keywords as $keyword) echo "define('KEYWORD_" . strtoupper($keyword) . "', '$keyword');\n";
OutputPage::getStatusMessage() is a method to convert a numeric HTTP status
code to an english message. It does not really belong to the OutputPage were
it was for historical reason.
This patch move the basic function to a non MediaWiki dependant class in our
directory includes/libs. We could potentially enhances it, but I do not see
any use cases for us yet.
I have renamed the method to the shorter 'getMessage' since the word 'status'
is now in the class name.
Summary of changes:
* OutputPage::getStatusMessage becomes HttpStatus::getMessage
* Method moved to the new includes/libs/HttpStatus.php
* Autoloader updated
* History kept by using 'svn copy'
* No functional changes
* No input/output format changes
* Old occurences modified in phase3
* OutputPage::getStatusMessages() marked as deprecated
PHPUnit test suite is fine.
Tested manually using a redirection
* Moved most of the bug 28235 code out to a separate library class, since I was running out of distinct function names.
* Merged the QUERY_STRING and PATH_INFO security checks, since they are dealing with the exact same problem. Removed WebRequest::isQueryStringBad().
* Deal with img_auth.php by having it specify what extension it expects to be streaming out. This extension can then be compared with the extension that IE might detect.
CSSMin::minify()'s processing of url references for path adjustment or embedding had excluded explicit fully-qualified http: and https: URLs, but was damaging others such as data: URIs that were actually hardcoded into the original CSS.
This was affecting styles used on no.wikipedia.org which embedded a few icons directly into the style sheet.
Now checking for any URL scheme rather than hardcoding a check for http & https.
* (bug 28591) Update/replace/supplement spyc (YAML parsing library)
* YAML API output is now 1.2 compliant, using JSON as the formatter
YAML 1.2 spec is a JSON subset - "The primary objective of this revision is to bring YAML into compliance with JSON as an official subset. YAML 1.2 is compatible with 1.1 for most practical applications - this is a minor revision." [1] Per discussion with Tim, switch YAML to use the JSON formatter
Was originally going to delete the ApiFormatYaml per Tim, but class needed to keep nicer (and apparent) output in API help page
Hence made subclass ApiFormatJson, minimal method overriding
spyc.php deleted from libs
[1] http://www.yaml.org/spec/1.2/spec.html#id2803629