Commit graph

8 commits

Author SHA1 Message Date
Daniel Friesen
3842f9a262 Preemptively add css3's image() to our css sanitizer.
- Adding this now even though no browser supports it so that when one does it doesn't become a way to bypass our url() filter.
- Including missing tests for all of our insecure input filters.
- Also make sure that vendor prefixed versions like -webkit-image() are caught because most browsers are probably going to go and implement a vendor prefixed version first.

Change-Id: If73aa98b8accdb7621b0e4ff0615b61d530fa547
2012-09-26 05:24:16 +00:00
Antoine Musso
218d50c0c3 (bug 40306) Only convert align to float for table.
Align should be converted to text-align for all the elements specified
in $presentationalAttribs mapping. Table however is an exception, it
applies to alignment of the block (instead of the content).

Follow up I108cbd10 / 27a4d74bd7.

Change-Id: Iee17d4ef1a6a9b46d88a330cfc9179bccfe93247
2012-09-18 14:44:50 +02:00
Max Semenik
27a4d74bd7 (bug 36495) Sanitizer: Convert align to margin/float outside tables.
Change-Id: I108cbd100cff6bade011b14d74b5bca82f2a1e5f
2012-07-03 08:54:46 +02:00
Antoine Musso
1b39c964ab Test handling of escaped CSS comments
r85856 fixed a CSS injection issue but lacked testing. This
test verify we properly strip out CSS comments even when the
token delimiter '/*' is backslash-escaped : \2f\2a
2011-10-24 08:39:58 +00:00
Daniel Friesen
453528cc4b Followup r94465 and r94465; Add phpunit tests for Sanitizer::fixDeprecatedAttributes and fix bugs related to clear="all" and mixed/uppercase attributes and values. 2011-09-25 04:08:23 +00:00
Platonides
b856f6605b (Bug 27539) Allow attributes beginning with a digit in wiktext tag parameters.
Its removal in r70849 breaks ProofreadPage extension.
Restricted r82475 relaxation to just numbers.
Added tests.

This only affects wikitext (tag hooks).
MW_ATTRIBS_REGEX is only used through decodeTagAttributes() calls.
fixTagAttributes() calls decodeTagAttributes(), and would be nastier to 
fix, since it is called with HTML parameters (eg. by removeHTMLtags)
but such incorrect parameters grabbed would be removed by validateTagAttributes()
2011-02-19 20:16:54 +00:00
Chad Horohoe
447529064b * verbose and color default output from phpunit
* Make a bunch of tests subclass MediaWikiTestCase
* Parser tests and ResourceLoaderTest can't subclass it yet due to various issues
2010-12-28 18:17:16 +00:00
Chad Horohoe
23f69f10ed Per wikitech-l discussion: Move tests from maintenance/tests/ to tests/. They're not strictly maintenance scripts, and some people want to do a selective checkout that doesn't include the tests. There's still debate on whether we should include these in the release downloads, but we had a pretty firm consensus to move this. 2010-12-14 16:26:35 +00:00