0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-09-20 03:05:18 +00:00
Commit Graph

99 Commits

Author SHA1 Message Date
Edward Z. Yang
a2880bdff2 Generalize IDAccumulator into AttrContext. Modify tests and classes accordingly. Also, this allows us to make the validate() parameters uniform among all AttrDef subclasses.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@212 48356398-32a2-884e-a903-53898d9a118a
2006-08-12 16:04:40 +00:00
Edward Z. Yang
77f2833f36 Fix PHP 4 problems with references.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@211 48356398-32a2-884e-a903-53898d9a118a
2006-08-12 04:07:06 +00:00
Edward Z. Yang
c2ec56b872 Initial implementation of URISchemeRegistry (fixed overload bug in process). Also, add extra notes to some of the unit tests.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@210 48356398-32a2-884e-a903-53898d9a118a
2006-08-12 03:56:27 +00:00
Edward Z. Yang
4ab6cab15c Finish bare-bones implementation of URI. This will suffice for now.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@209 48356398-32a2-884e-a903-53898d9a118a
2006-08-12 03:35:05 +00:00
Edward Z. Yang
4b097ef493 Commit initial URI unit tests and implementation. They're not complete yet though.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@206 48356398-32a2-884e-a903-53898d9a118a
2006-08-12 01:12:35 +00:00
Edward Z. Yang
0db1cbb7ac Revamp Configuration classes, breaking backwards configuration compatibility (not that there was much to broken to begin with). Fix bug involving PHP 4 object typecasting.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@203 48356398-32a2-884e-a903-53898d9a118a
2006-08-11 20:23:41 +00:00
Edward Z. Yang
3c2c0c1a1b Make PEAR tests configurable.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@201 48356398-32a2-884e-a903-53898d9a118a
2006-08-10 12:41:39 +00:00
Edward Z. Yang
4d224c5013 Use configuration in test runner.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@200 48356398-32a2-884e-a903-53898d9a118a
2006-08-10 12:22:55 +00:00
Edward Z. Yang
d5e75f2616 Add NumberSpan definition (non-DTD, but applies to enough to be useful). All widely used non-deprecated attributes have been implemented (except for rel/rev, but that's tricky). Add note about quirky COL handling and possible implementation of a workaround.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@174 48356398-32a2-884e-a903-53898d9a118a
2006-08-06 03:58:48 +00:00
Edward Z. Yang
d429989f86 Implement MultiLength.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@173 48356398-32a2-884e-a903-53898d9a118a
2006-08-06 01:41:18 +00:00
Edward Z. Yang
2d8e4f3993 Bugfix: Fix include typo.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@172 48356398-32a2-884e-a903-53898d9a118a
2006-08-06 01:38:47 +00:00
Edward Z. Yang
cffcd7c661 Bugfix: Rewire a require_once.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@171 48356398-32a2-884e-a903-53898d9a118a
2006-08-06 01:31:33 +00:00
Edward Z. Yang
fb18fe31e1 AttrDef_Length implemented. Reuses a bit of stuff from Pixel.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@170 48356398-32a2-884e-a903-53898d9a118a
2006-08-06 01:30:54 +00:00
Edward Z. Yang
a520b5469e Implement Pixels attribute definition.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@169 48356398-32a2-884e-a903-53898d9a118a
2006-08-06 01:03:48 +00:00
Edward Z. Yang
fdc838c75e Reuse attribute definitions to define a few more attributes.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@168 48356398-32a2-884e-a903-53898d9a118a
2006-08-05 22:14:19 +00:00
Edward Z. Yang
a4ce51cca2 Add case sensitivity test.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@167 48356398-32a2-884e-a903-53898d9a118a
2006-08-05 19:52:30 +00:00
Edward Z. Yang
2deb2fc285 Implement TextAlign and all hooks necessary, but it's kind of useless since CSS validation hasn't been built yet.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@166 48356398-32a2-884e-a903-53898d9a118a
2006-08-05 02:56:57 +00:00
Edward Z. Yang
60f769d088 Augment test suite, allowing only single files to be tested.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@165 48356398-32a2-884e-a903-53898d9a118a
2006-08-05 02:28:35 +00:00
Edward Z. Yang
9d390fca56 Refactor AttrTransform_Lang slightly by changing input output from token to attribute.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@163 48356398-32a2-884e-a903-53898d9a118a
2006-08-05 02:16:28 +00:00
Edward Z. Yang
8a23710405 Implement lang and xml:lang. Fixed a bunch of bugs too.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@162 48356398-32a2-884e-a903-53898d9a118a
2006-08-05 01:50:13 +00:00
Edward Z. Yang
1945ddca5c Refactor unit tests so that abstract test cases are now called Harnesses and AttrDef tests use their harness's assertDef() function, which enforces type much better. Also fixed a few bugs.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@161 48356398-32a2-884e-a903-53898d9a118a
2006-08-05 00:30:31 +00:00
Edward Z. Yang
6232221c08 Define AttrDef_Text and parseCDATA().
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@160 48356398-32a2-884e-a903-53898d9a118a
2006-08-04 03:13:04 +00:00
Edward Z. Yang
b267b0c202 Add an attribute entity parse test to Lexer and change PEARSax3 to a proof of concept.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@158 48356398-32a2-884e-a903-53898d9a118a
2006-08-04 02:59:15 +00:00
Edward Z. Yang
a2fc5da060 Implement AttrDef_Class.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@157 48356398-32a2-884e-a903-53898d9a118a
2006-08-04 02:48:20 +00:00
Edward Z. Yang
784b756b3f Add configuration as a parameter to all AttrDef objects. If we get another construction like accumulator, however, we'll have to create an AttrContext object.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@156 48356398-32a2-884e-a903-53898d9a118a
2006-08-04 01:52:54 +00:00
Edward Z. Yang
a0ee772423 Set up configuration class, implement attr_id_blacklist
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@155 48356398-32a2-884e-a903-53898d9a118a
2006-08-04 01:47:48 +00:00
Edward Z. Yang
7d2bf08d2f Implement simple attribute transformations and roll them out.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@152 48356398-32a2-884e-a903-53898d9a118a
2006-08-04 00:11:54 +00:00
Edward Z. Yang
26733183b7 Add support for hard exclusions that affect all child nodes.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@146 48356398-32a2-884e-a903-53898d9a118a
2006-08-03 01:18:57 +00:00
Edward Z. Yang
aa249be067 Fix chameleon behavior with ins and del.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@145 48356398-32a2-884e-a903-53898d9a118a
2006-08-03 01:03:23 +00:00
Edward Z. Yang
064fd603d3 Commit TagTransform_Font and associated test-cases.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@143 48356398-32a2-884e-a903-53898d9a118a
2006-08-03 00:14:10 +00:00
Edward Z. Yang
80281dda55 Fix case-sensitivity issues for attributes. Added TokenTest. Updated TODO. Removed TagTransform::normalizeAttributes
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@142 48356398-32a2-884e-a903-53898d9a118a
2006-08-02 02:43:52 +00:00
Edward Z. Yang
626cfc1172 Implement center, menu and dir tag transformations. Font transform pending.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@140 48356398-32a2-884e-a903-53898d9a118a
2006-08-02 02:24:03 +00:00
Edward Z. Yang
d243545142 Compat changes with earlier versions of PHP.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@139 48356398-32a2-884e-a903-53898d9a118a
2006-08-01 01:57:22 +00:00
Edward Z. Yang
f63e870300 Quality control, improve a little documentation and fix UTF-8 unfriendliness in the Generator.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@138 48356398-32a2-884e-a903-53898d9a118a
2006-08-01 00:29:38 +00:00
Edward Z. Yang
79e5cd4543 Augment test file so we can run from cli.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@137 48356398-32a2-884e-a903-53898d9a118a
2006-08-01 00:18:22 +00:00
Edward Z. Yang
9d411bd5cc - Implement double-checking in Strategy/FixNesting.php, fixes the table bugs.
- Move around child definitions so they make a little more sense (rename to Custom) and also add $allow_empty property to help FixNesting.php determine whether or not to double-check.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@136 48356398-32a2-884e-a903-53898d9a118a
2006-07-31 03:04:57 +00:00
Edward Z. Yang
9c6ae16764 Massively refactored Definition, moved MakeWellFormed HTML specific code out.
Add table functionality for nesting, don't know how I missed that. It's still broken though.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@135 48356398-32a2-884e-a903-53898d9a118a
2006-07-31 00:15:01 +00:00
Edward Z. Yang
70bd80e66a Added ValidateAttributes strategy and associated unit tests. Amended Generator with some sanity checks. Made Definition include all necessary definitions. Note the two elements (bdo and br) that only use coreattrs.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@132 48356398-32a2-884e-a903-53898d9a118a
2006-07-30 18:37:42 +00:00
Edward Z. Yang
bb0435bdd4 Add AttrDef_Id, as well as amend the accumulator by adding a load.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@131 48356398-32a2-884e-a903-53898d9a118a
2006-07-30 16:35:05 +00:00
Edward Z. Yang
bba0d0b77a Remove Singleton functionality, the accumulator will just have to be passed around.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@130 48356398-32a2-884e-a903-53898d9a118a
2006-07-30 16:01:24 +00:00
Edward Z. Yang
4ab930dab4 Add IDAccumulator.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@129 48356398-32a2-884e-a903-53898d9a118a
2006-07-30 15:52:25 +00:00
Edward Z. Yang
f8eaedb500 Factor out definitions to a ['child'] so that we could assign the ['attr'] definitions separately.
Also, added AttrDef/EnumTest.php

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@127 48356398-32a2-884e-a903-53898d9a118a
2006-07-30 00:54:38 +00:00
Edward Z. Yang
9b7ad89ab5 - Added Composite and Core strategies.
- Added generate_mock() function for testing
- Factored out inputs/output tests to StrategyAbstractTest

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@124 48356398-32a2-884e-a903-53898d9a118a
2006-07-29 17:38:28 +00:00
Edward Z. Yang
619d5d9bc1 Migrate strategies to separate classes complete.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@119 48356398-32a2-884e-a903-53898d9a118a
2006-07-24 02:49:37 +00:00
Edward Z. Yang
f75e8dab8c Extract FixNestingTest from DefinitionTest.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@118 48356398-32a2-884e-a903-53898d9a118a
2006-07-24 02:43:53 +00:00
Edward Z. Yang
63396bb076 Extract MakeWellFormedTest from DefinitionTest.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@117 48356398-32a2-884e-a903-53898d9a118a
2006-07-24 02:41:06 +00:00
Edward Z. Yang
4c200f6bcb Extract RemoveForeignElementsTest from Definition.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@116 48356398-32a2-884e-a903-53898d9a118a
2006-07-24 02:33:07 +00:00
Edward Z. Yang
e768f845f4 Extract common functionality to StrategyAbstractTest.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@115 48356398-32a2-884e-a903-53898d9a118a
2006-07-24 02:28:40 +00:00
Edward Z. Yang
dfb3d48397 Migrate DefinitionTest to use DirectLex for easier to read test-cases.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@109 48356398-32a2-884e-a903-53898d9a118a
2006-07-24 01:22:51 +00:00
Edward Z. Yang
609977f9f5 Add CDATA support to the Lexers, as well as give PEARSax3 entity replacement.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@106 48356398-32a2-884e-a903-53898d9a118a
2006-07-23 23:04:34 +00:00