aboutsummaryrefslogtreecommitdiffstats
path: root/includes/libs
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug in CSSJanus where background-position and background-position-x ↵Roan Kattouw2012-02-021-2/+2
| | | | | | | weren't flipped if negative values were given. Trevor found this by running the original CSSJanus test suite against his NodeJS port; I should port the test suite to PHPUnit some time Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/110587
* (bug 34114) CSSMin::remap() doesn't respect its $embed parameter. Patch by ↵Roan Kattouw2012-02-021-3/+3
| | | | | | | Gilles van den Hoven Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/110557
* Revert r103978, r103979 -- screwed something up, breaks jQuery minification.Brion Vibber2011-11-231-7/+9
| | | | | | | | Incremented ResourceLoader::filterCacheVersion rather than decrementing to avoid potential confusion, especially since we already needed the incr. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/103988
* Functional part of r103978 (d'oh!) plus an update to the ResourceLoader ↵Brion Vibber2011-11-221-9/+7
| | | | | | | filter cache key, so broken entries stuck in cache will be reloaded. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/103979
* Final fixup to r103910 and follow-ups.Platonides2011-11-221-1/+1
| | | | | | | Reverts r103931 test change. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/103940
* Two decimal points may be valid, as 5..toString() == (5.).toString()Platonides2011-11-221-2/+2
| | | | | | | Added some tests Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/103937
* Follow-up r103915: We need to increment $end before the strcspn.Platonides2011-11-221-1/+2
| | | | | | | Adjusting the tests, since it is now adding the newline after the number. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/103931
* Follow-up r103915. The @fixme of r103865 was wrong.Platonides2011-11-221-5/+1
| | | | | | | | | It is apparently legal to have a decimal point without after it, eg. var a = 5. Not for hexadecimal numbers. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/103928
* Fix r103865 fixmes about case where there a parse error should be raised.Platonides2011-11-221-10/+27
| | | | | | | Also detect as an error 1..0 or 1eeeeee5 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/103915
* Follow-up r103865. Accept lowercase hex and remove empty statement.Platonides2011-11-221-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/103910
* * (bug 32548) fix minification bug when numeric literal with exponent was ↵Brion Vibber2011-11-211-13/+24
| | | | | | | | | | | | | | | split over lines 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. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/103865
* More documentation!Sam Reed2011-10-264-56/+109
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/100783
* Update some deprecated codeSam Reed2011-10-141-1/+1
| | | | | | | | | | | Documentation Fix "/*" comments to "/**" Flesh out some missing returns, change some return types Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/99808
* * (bug 31187) Fix for user JavaScript validation to allow identifiers with ↵Brion Vibber2011-09-271-5/+52
| | | | | | | | | | | | | | | | | | | | valid Unicode letter characters 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) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/98281
* Followup to r92580 and r93820: r92580 duplicated the call to wfExpandUrl(), ↵Roan Kattouw2011-08-141-2/+2
| | | | | | | and r93820 caused them to get out of sync. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/94456
* Fix syntax error in r93820Roan Kattouw2011-08-031-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/93822
* Fix r93820: PROT_ -> PROTO_Roan Kattouw2011-08-031-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/93821
* Some random URL protocol forcing for protocol-relative URLsRoan Kattouw2011-08-031-4/+5
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/93820
* Clarify dual-licensing (GPL&Apache) of CSSJanus. Has no significant ↵Roan Kattouw2011-07-311-1/+3
| | | | | | | contributions (i.e. changes other than very minor whitespace and Doxygen changes) by anyone other than me. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/93562
* Update JSMin+ to the newly released 1.4Platonides2011-07-241-92/+131
| | | | | | | This upstream release incorporates r92560 and r92563 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/93020
* Fixes for URL expanding in CSSMin: adjust the offset correctly (this ↵Roan Kattouw2011-07-191-4/+11
| | | | | | | could've theoretically resulted in very strange bugs) and only call wfExpandUrl() if available (the file is in includes/libs so it should work outside of MediaWiki) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/92580
* Expand the defines from JSTokenizer::__construct() placing them at the top ↵Platonides2011-07-191-11/+78
| | | | | | | | | | | | | | | | of the file. 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"; Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/92563
* Remove double ; and final ?> from jsminplus (imported in r91591).Platonides2011-07-191-2/+2
| | | | | | | This should be uncontroversial. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/92560
* Followup r83885: add JSMin+ 1.3 to use its parser to verify output of ↵Brion Vibber2011-07-061-0/+1980
| | | | | | | | | | | JavaScriptMinifierTest unit test cases. Had to change some of the test cases because they were not valid JavaScript programs -- one of the quoting tests was incorrectly quoted in the PHP sources, and several tests around return, continue, and break keywords failed due to not using them in the contexts that they require. http://crisp.tweakblogs.net/blog/1856/jsmin+-version-13.html JSMin+ under MPL 1.1/ GPL 2.0 / LGPL 2.1 license. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91591
* HTTP status messages move: OutputPage -> HttpStatusAntoine Musso2011-07-041-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91425
* Swap else if for elseifSam Reed2011-06-171-17/+17
| | | | | | | | | Trimming trailing whitespace also Doing in 3 commits, so hopefully reviewable in CR... Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/90280
* * Added a REQUEST_URI check to the bug 28235 handling. Tim Starling2011-06-061-0/+247
| | | | | | | | | * 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. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89558
* * (bug 25262) Fix for minification of hardcoded data: URIs in CSSBrion Vibber2011-05-101-2/+3
| | | | | | | | | | 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. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/87840
* Removed JavaScriptDistiller: unusedMax Semenik2011-04-191-337/+0
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/86385
* * (bug 28586) YAML: strings that are the same as boolean literalsSam Reed2011-04-181-248/+0
| | | | | | | | | | | | | | | | | | * (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 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/86302
* removing another use of the vertical tab & form feed escapes, which are not ↵Neil Kandalgaonkar2011-03-151-1/+1
| | | | | | | available in production php5.2.4 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/83998
* the vertical tab \v and form feed \f escapes are not available in php5.2.4 ↵Neil Kandalgaonkar2011-03-151-1/+1
| | | | | | | which is what we run in production. Using equivalent hexadecimal Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/83997
* oops, don't delete char before the slash, followup to r83902Ryan Kaldari2011-03-151-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/83989
* keep double slash filter from breaking absolute URLs, fix to r83902Ryan Kaldari2011-03-151-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/83988
* Followup r83891: don't insert a newline before ++ or -- . Patch by Paul ↵Roan Kattouw2011-03-141-2/+3
| | | | | | | Copperman Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/83934
* (bug 27052) CSSMin generated URLs like foo//../bar in some cases, which ↵Roan Kattouw2011-03-141-0/+3
| | | | | | | apparently resolves to foo/bar rather than foo/../bar or bar . Fixed by eliminating duplicate slashes from the file URL when remapping Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/83902
* Followup r83885: implement maximum line length and statement termination ↵Roan Kattouw2011-03-141-3/+51
| | | | | | | (each statement on its own line) in JavaScriptMinifier. Also add globals for these things and update minify.php for these new config vars. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/83891
* (bug 27528) Incorporate Paul Copperman's minifierRoan Kattouw2011-03-141-0/+530
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/83885
* (bug 27328) Redo r82218 properly, expanding URLs with absolute pathsRoan Kattouw2011-02-191-0/+11
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82457
* Revert r82218 , doesn't fix absolute path URLs but breaks them. Will fix ↵Roan Kattouw2011-02-191-2/+2
| | | | | | | properly in next commit Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82456
* Remove comment that makes no sense post r82399Roan Kattouw2011-02-181-1/+0
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82401
* Fix comments and whitespace for \\\\ .Tim Starling2011-02-181-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82400
* JavaScriptDistiller fixes:Tim Starling2011-02-181-32/+28
| | | | | | | | | | | | * Removed some repeated subexpressions, /(.)*/ etc. These cause the stack space to be rapidly exhausted, leading to a segfault for malicious input. I replaced the ([\r\n]|.) subexpressions with a dot with a /s modifier. Added a pcre.recursion_limit hack to take care of the rest. * Supported assertions and non-capturing subpatterns in ParseMaster::add() by recognising that parentheses that aren't followed by "?" are capturing. Used another assertion to do this. * Fixed a bug whereby if a single-line comment had a slash in it, it was recognised as a regex instead of a comment. This occurred because the leading whitespace caused the regex regex to match at an earlier string position than the comment regex, giving it undue precedence. This was the subject of several reports on IRC and the main reason for me starting work on JavaScriptDistiller. Used a lookbehind assertion. * Give comments precedence over regexes and strings where there is ambiguity at the same string location. Not sure if this does anything, but it seemed like a good idea at the time. * Removed unused variable ParseMaster::$TRIM. * To test it, I ran the old and new jquery.js output through Google Closure Compiler. The result was the same, proving that there are no functional differences. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82399
* Remove useless elseif compare. If the else if is doing the inverse (!) of ↵Sam Reed2011-02-181-1/+1
| | | | | | | the original if, it's redundant Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82388
* Comment out 2 unused lines in JavaScriptDistillerSam Reed2011-02-181-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82387
* * For readability, use /x in regexes. Removed the start and end slashes from ↵Tim Starling2011-02-181-19/+56
| | | | | | | | | | the input to ParseMaster::add(), to avoid confusion over the lack of a /x modifier in that input. * Broke up several regexes and added comments, so that humans might be able to understand them. * Tested md5(minify(jquery.js)) as before. Checked speed, it's the same. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82384
* Made the regexes slightly more readable by undoubling the backslashes where ↵Tim Starling2011-02-181-21/+21
| | | | | | | possible. Tested by ensuring that the minifier output is the same before and after, with jquery.js as input. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82380
* Fix a bug in string recognition in JSDistiller. This *really* fixes bug 27481Roan Kattouw2011-02-171-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82357
* Fix for r82344, which causes JSDistiller to stop minifying comments because ↵Roan Kattouw2011-02-171-2/+2
| | | | | | | it thought they were regexes. Make the regex regex a little bit stricter again, forbidding a regex from starting with * and other invalid things that were disallowed prior to r82344 (but still dropping / ) and forbidding multiline regexes Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82352
* Revert r82340, caused something linke bug 27481 where spaces were being ↵Roan Kattouw2011-02-171-2/+2
| | | | | | | wrongly collapsed. Fixed by changing regex to be more flexible in protecting regexes; nothing wrong with being overinclusive in what we're protecting Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82344