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

535 Commits

Author SHA1 Message Date
Edward Z. Yang
c0b5bc3eea [3.1.0] Implement NamespaceExists and ParseId
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1599 48356398-32a2-884e-a903-53898d9a118a
2008-03-04 05:21:04 +00:00
Edward Z. Yang
14437cbf47 - Rename Duplicate to Unique, as the name of validator indicates what we want the input to be
- Enable flush to work when includes are renamed

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1597 48356398-32a2-884e-a903-53898d9a118a
2008-03-04 04:20:55 +00:00
Edward Z. Yang
4c798bd17e [3.1.0] Implement Duplicate validator, also modify some design things
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1596 48356398-32a2-884e-a903-53898d9a118a
2008-03-04 04:13:07 +00:00
Edward Z. Yang
d8cb360f3b Refactor validators so that they can be reused between directives and namespaces.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1589 48356398-32a2-884e-a903-53898d9a118a
2008-03-02 04:39:14 +00:00
Edward Z. Yang
0d9c05d13c [3.1.0] Create decorator validator/adapter for Interchange.
- Output flush output

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1587 48356398-32a2-884e-a903-53898d9a118a
2008-03-02 04:00:43 +00:00
Edward Z. Yang
d81bcbd208 Remove decorator pattern from validator; we'll only have one decorator which invokes the subsystem.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1586 48356398-32a2-884e-a903-53898d9a118a
2008-03-02 02:57:31 +00:00
Edward Z. Yang
fa6b6fe85f [3.1.0] Reconfigure tester to glob for test files using *Test.php pattern.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1585 48356398-32a2-884e-a903-53898d9a118a
2008-03-02 02:05:47 +00:00
Edward Z. Yang
8bda0c4dfb [3.1.0] Refactor out validation framework for Interchange
- Implement IdExists validator

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1584 48356398-32a2-884e-a903-53898d9a118a
2008-03-02 01:55:14 +00:00
Edward Z. Yang
d682a59a68 Make magic quotes fix play more nicely with PHP 5.3, but it's now untested.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1583 48356398-32a2-884e-a903-53898d9a118a
2008-03-01 18:09:52 +00:00
Edward Z. Yang
240b565513 [3.1.0] Implement ConfigSchema interchange
- Implement exception hierarchy

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1582 48356398-32a2-884e-a903-53898d9a118a
2008-03-01 17:06:23 +00:00
Edward Z. Yang
2cc535ad84 [3.1.0] Support for display/visibility CSS with %CSS.AllowTricky
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1579 48356398-32a2-884e-a903-53898d9a118a
2008-02-25 22:05:49 +00:00
Edward Z. Yang
30eb982961 [3.1.0] Add support for !important, with %CSS.AllowImportant
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1578 48356398-32a2-884e-a903-53898d9a118a
2008-02-25 21:58:17 +00:00
Edward Z. Yang
002fe649f7 [3.1.0] Move ConfigSchema to HTMLPurifier core
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1576 48356398-32a2-884e-a903-53898d9a118a
2008-02-24 06:19:28 +00:00
Edward Z. Yang
cb793cd9b9 - Restore substr_count compatibility method; it's not just PHP 4
- Update missing includes
- Fix generate-standalone.php fatal error
- Make LexerTest resilient against variant versions of libxml

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1573 48356398-32a2-884e-a903-53898d9a118a
2008-02-20 01:28:19 +00:00
Edward Z. Yang
b5f1c76ee8 [3.1.0] Implement Proprietary HTML module with <marquee>
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1572 48356398-32a2-884e-a903-53898d9a118a
2008-02-20 00:53:09 +00:00
Edward Z. Yang
f2863557f5 [3.1.0] Make static ConfigSchema methods throw errors.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1571 48356398-32a2-884e-a903-53898d9a118a
2008-02-20 00:37:08 +00:00
Edward Z. Yang
6c9c8f2380 [3.1.0] [BACKPORT] Fix bug with comments in styles, and some associated issues
- Restore printTokens()

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1570 48356398-32a2-884e-a903-53898d9a118a
2008-02-20 00:15:44 +00:00
Edward Z. Yang
fbc595ebed Remove includes from unit tests.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1569 48356398-32a2-884e-a903-53898d9a118a
2008-02-18 04:41:42 +00:00
Edward Z. Yang
21cf2c94d4 - Gracefully error out of obscure bug involving non-static autoloaders
- Test multiple autoloaders
- Remove local URL test; doesn't work for other people

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1565 48356398-32a2-884e-a903-53898d9a118a
2008-02-18 02:33:50 +00:00
Edward Z. Yang
a4abc45505 All PHPT tests for now complete! Fix an SPL autoload bug.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1564 48356398-32a2-884e-a903-53898d9a118a
2008-02-18 01:11:17 +00:00
Edward Z. Yang
969a027a5b Rename to spl-autoload to more descriptive spl-autoload-and-user-autoload
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1563 48356398-32a2-884e-a903-53898d9a118a
2008-02-18 00:55:10 +00:00
Edward Z. Yang
e3fdda1f3c - Bulk up loading PHPT tests.
- Fix documentation error with regards to standalone path behavior

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1562 48356398-32a2-884e-a903-53898d9a118a
2008-02-18 00:49:45 +00:00
Edward Z. Yang
40d3d5b961 [3.1.0] Fix broken autoloader, resulting in duplicate classes
- Factor out phpt directory parsing
- More phpt tests

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1561 48356398-32a2-884e-a903-53898d9a118a
2008-02-17 23:59:23 +00:00
Edward Z. Yang
4c24a51054 Numerous documentation and test code fixes for HTML Purifier loading
- Improve documentation for stub files
- Synchronize stub files between extras/ and library/
- Remove unnecessary include in function file
- Remove special treatment of Bootstrap
- Improve docs for HTMLPurifier, converted singleton to use static member variables and removed reference
- Add HTMLPurifier.path.php stub file
- Update sample test settings
- Reorganize includes in test files

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1559 48356398-32a2-884e-a903-53898d9a118a
2008-02-17 18:21:45 +00:00
Edward Z. Yang
51da183f80 - Enable blank params to mean true for booleans again
- Make reporter send val=1 anyway
- Add htmlpurifier.org remote test

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1557 48356398-32a2-884e-a903-53898d9a118a
2008-02-17 01:07:17 +00:00
Edward Z. Yang
212958a9c7 - Make phpt files svn:eol-style=native
- Add missing NEWS entry

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1556 48356398-32a2-884e-a903-53898d9a118a
2008-02-17 00:19:27 +00:00
Edward Z. Yang
8c439aa62c [3.1.0] multitest.php now works again for all version, however, some hacks to PHPT are required
- Bootstrap hotfix to prevent multiple loading in standalone. We need a better way of doing this!
- Make extras/ autoloader polite too
- Initialize autoloaders in common.php
- Add trailing dash to "skip" in phpt
- Upgrade SimpleTest.php not to allow directories

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1554 48356398-32a2-884e-a903-53898d9a118a
2008-02-16 18:03:51 +00:00
Edward Z. Yang
929d932234 [3.1.0] Implement a few phpt, fix some autoload bugs
- Make our autoload handler polite, ensuring that any __autoload() 
functions get added
- Modify phpt calling code so that each phpt files gets its own 
test-case (this lets us run one phpt file at a time)
- Implement phpt for loading, which test varying loading methods of HTML 
Purifier
- Add --disable-phpt and --only-phpt flags
- More descriptive veto messages, also fix test count



git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1552 48356398-32a2-884e-a903-53898d9a118a
2008-02-16 05:40:59 +00:00
Edward Z. Yang
3441421e8b [3.1.0] Land PHPT integration (currently required; we'll relax this later)
- Port ConfigSchema and Config tests to new syntax
- Deprecate Debugger
- Add $schema params to most Config convenience functions
- Add --php flag to testing scripts for command line
- NOT TESTED WITH MULTITEST.PHP!


git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1551 48356398-32a2-884e-a903-53898d9a118a
2008-02-16 00:40:30 +00:00
Edward Z. Yang
b6c9dcefd7 Implement schema extraction script; almost done except for version extraction. Also, some minor refinements.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1534 48356398-32a2-884e-a903-53898d9a118a
2008-02-07 19:29:08 +00:00
Edward Z. Yang
a74a590f1c [3.1.0] Remove multi-description functionality as well as file detection.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1525 48356398-32a2-884e-a903-53898d9a118a
2008-01-27 20:21:31 +00:00
Edward Z. Yang
57f897661e [3.1.0] [BACKPORT] Fix <span><span><div> by sending back to the front of the loop for reprocessing.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1492 48356398-32a2-884e-a903-53898d9a118a
2008-01-10 21:40:41 +00:00
Edward Z. Yang
be7c1e7a8f [3.0.0] Upgraded test scripts and other goodies. Also removed some PHP4 cruft.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1482 48356398-32a2-884e-a903-53898d9a118a
2008-01-07 00:17:49 +00:00
Edward Z. Yang
38a59ef5b8 Completely remove style if naughty selector is found. This is for compatibility reasons until Tidy 1.4 is released.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1480 48356398-32a2-884e-a903-53898d9a118a
2008-01-06 05:36:48 +00:00
Edward Z. Yang
8779b46fc4 [3.0.0] Add global scoping support for ExtractStyleBlocks; scoped="" attribute bumped off for some 'other' time.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1478 48356398-32a2-884e-a903-53898d9a118a
2008-01-05 19:19:55 +00:00
Edward Z. Yang
a7fab00cdd [3.0.0] Convert all $context calls away from references
- Update TODO list
- URISchemeRegistry doesn't return a reference for instance anymore, should do the same for other singletons

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1477 48356398-32a2-884e-a903-53898d9a118a
2008-01-05 00:10:43 +00:00
Edward Z. Yang
ae1c8f47cc [3.0.0] Allow filter:none for proprietary filter property
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1474 48356398-32a2-884e-a903-53898d9a118a
2007-12-17 22:12:11 +00:00
Edward Z. Yang
0f961c6af4 [3.0.0] [BACKPORT] More work for hire from Chris
! Experimental support for some proprietary CSS attributes allowed: opacity (and all of the browser-specific equivalents) and scrollbar colors. Enable by setting %CSS.Proprietary to true.
- Colors missing # but in hex form will be corrected
- CSS Number algorithm improved
. New classes:
  + HTMLPurifier_AttrDef_CSS_AlphaValue
  + HTMLPurifier_AttrDef_CSS_Filter

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1473 48356398-32a2-884e-a903-53898d9a118a
2007-12-16 23:16:45 +00:00
Edward Z. Yang
5b3431d889 [3.0.0] Fully implement CSS extraction and cleaning. See NEWS for more information, it is now a Filter.
- Some Lexer things were moved around

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1469 48356398-32a2-884e-a903-53898d9a118a
2007-12-12 21:46:30 +00:00
Edward Z. Yang
831f552ec5 [3.0.0] <style> tags can now be extracted from input HTML using %HTML.ExtractStyleBlocks. These contents can be retrieved from $context->get('StyleBlocks');
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1468 48356398-32a2-884e-a903-53898d9a118a
2007-12-12 03:29:12 +00:00
Edward Z. Yang
62f3fd894d [3.0.0] [BACKPORT]
- Add register() for DefinitionCacheFactory so custom implementations can be specified
- Add docs for flush() regarding when this functionality is impossible to do
- Refactor unit tests in DefinitionCacheFactoryTest.php

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1464 48356398-32a2-884e-a903-53898d9a118a
2007-12-09 03:14:34 +00:00
Edward Z. Yang
b5546ff6f0 [3.0.0]
+ PHP4 reference/foreach cruft in Injector removed
. Unit tests for Injector improved
. Some todo stuff updated

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1462 48356398-32a2-884e-a903-53898d9a118a
2007-12-05 01:26:28 +00:00
Edward Z. Yang
7ddd9d0afe [3.0.0] [BACKPORT] Make CSS properties case-insensitive
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1461 48356398-32a2-884e-a903-53898d9a118a
2007-12-01 17:00:55 +00:00
Edward Z. Yang
3ef9bdf8a2 __construct'ify all main library classes.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1459 48356398-32a2-884e-a903-53898d9a118a
2007-11-29 04:29:51 +00:00
Edward Z. Yang
43f01925cd Convert to PHP 5 only codebase, adding visibility modifiers to all members and methods in the main library area (function only for test methods)
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1458 48356398-32a2-884e-a903-53898d9a118a
2007-11-25 02:24:39 +00:00
Edward Z. Yang
bb08f679f0 [2.1.3]
- Work around unnecessary DOMElement type-cast in PH5P that caused errors in PHP 5.1
- Work around PHP 4 SimpleTest lack-of-error complaining for one-time-only HTMLDefinition errors, this may indicate problems with error-collecting facilities in PHP 5
- Make ErrorCollectorEMock work in both PHP 4 and PHP 5
. tests/multitest.php allows you to test multiple versions by running tests/index.php through multiple interpreters using `phpv` shell script (you must provide this script!)
. Minor cosmetic change to flush-definition-cache.php: trailing newline is outputted
. Maintenance script for generating PH5P patch added, original PH5P source file also added under version control
. Full unit test runner script title made more descriptive with PHP version

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1440 48356398-32a2-884e-a903-53898d9a118a
2007-11-05 05:01:51 +00:00
Edward Z. Yang
552102f7f2 [2.1.3]
- HTMLDefinition->addElement now returns a reference to the created element object, as implied by the documentation
. Extend Injector hooks to allow for more powerful injector routines
. HTMLDefinition->addBlankElement created, as according to the HTMLModule method

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1425 48356398-32a2-884e-a903-53898d9a118a
2007-10-02 22:50:59 +00:00
Edward Z. Yang
f5371bbad4 [2.1.3]
- Buggy treatment of end tags of elements that have required attributes fixed (does not manifest on default tag-set)
- Spurious internal content reorganization error suppressed
. Error unit tests can now specify the expectation of no errors. Future iterations of the harness will be extremely strict about what errors are allowed

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1424 48356398-32a2-884e-a903-53898d9a118a
2007-10-02 01:19:46 +00:00
Edward Z. Yang
c8b020879d [2.1.3] Refine injector algorithm regarding behavior inside nodes that allow paragraphs inside them
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1423 48356398-32a2-884e-a903-53898d9a118a
2007-09-27 00:39:05 +00:00
Edward Z. Yang
094b20f58f [2.1.3] Fix PHP warning from MakeAbsolute, also improve URIFilter documentation
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1422 48356398-32a2-884e-a903-53898d9a118a
2007-09-27 00:07:27 +00:00
Edward Z. Yang
f2df669eec Refactor IDAccumulator so that unit tests now work, and initialization is inside the class.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1421 48356398-32a2-884e-a903-53898d9a118a
2007-09-26 23:36:37 +00:00
Edward Z. Yang
1f9a6ba30e [2.1.3] Activate strict blockquote functionality for HTML 4.01 Strict.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1417 48356398-32a2-884e-a903-53898d9a118a
2007-09-09 01:46:59 +00:00
Edward Z. Yang
28c29656af [2.1.3] Fix off-by-one bug in injector functionality for dormant injectors
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1415 48356398-32a2-884e-a903-53898d9a118a
2007-09-09 01:27:09 +00:00
Edward Z. Yang
5b3c8c5534 [2.1.2] Implement border-spacing
- Fix PH5P testing in PHP4

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1401 48356398-32a2-884e-a903-53898d9a118a
2007-09-03 15:16:33 +00:00
Edward Z. Yang
cb92a57e4e [2.1.2] Implement experimental HTML5 parsing using PH5P
- Fix debugger so that tokens can be printed without an index
- Fix some broken PEAR unit tests

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1383 48356398-32a2-884e-a903-53898d9a118a
2007-08-19 18:49:35 +00:00
Edward Z. Yang
9881a34712 More unit test refactoring into seperate methods.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1380 48356398-32a2-884e-a903-53898d9a118a
2007-08-16 06:48:24 +00:00
Edward Z. Yang
a19f30fdcf [2.1.2] Fix silly little typo with border-collapse:separate
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1379 48356398-32a2-884e-a903-53898d9a118a
2007-08-11 06:52:26 +00:00
Edward Z. Yang
8f58c7f49e [2.1.2?] Final migration for Injectors, deprecate the config and context parameters in assertResult
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1378 48356398-32a2-884e-a903-53898d9a118a
2007-08-08 05:38:52 +00:00
Edward Z. Yang
71301b36eb [2.1.2?] Implemented Object module for trusted users.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1377 48356398-32a2-884e-a903-53898d9a118a
2007-08-08 05:16:15 +00:00
Edward Z. Yang
4f0d012dfa [2.1.2?] Add missing sub-tests for strategy, fix error message typo.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1376 48356398-32a2-884e-a903-53898d9a118a
2007-08-08 05:08:59 +00:00
Edward Z. Yang
24a4dfdf83 [2.1.2?] Fix invisible DirectLex parsing error with empty elements that have attributes containing slashes
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1375 48356398-32a2-884e-a903-53898d9a118a
2007-08-08 05:05:30 +00:00
Edward Z. Yang
f922285383 More unit test refactoring; remove unnecessary periods from HTMLDefinition error messages
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1374 48356398-32a2-884e-a903-53898d9a118a
2007-08-07 05:38:22 +00:00
Edward Z. Yang
3af6457801 Refactor unit tests to have one logical assertion per method.
- Support executing a single unit tests using __only prefix
- Hook in Email classes to main code, even if they're unused


git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1373 48356398-32a2-884e-a903-53898d9a118a
2007-08-06 06:22:23 +00:00
Edward Z. Yang
79c18eb781 [2.1.1] Single test methods can be invoked by prefixing them with __only
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1363 48356398-32a2-884e-a903-53898d9a118a
2007-08-04 14:51:06 +00:00
Edward Z. Yang
b3aa5fa0dc [2.1.1] Add prefix directory to include path in standalone: this prevents PEAR from clobbering our unit tests
- Add missing include to unit test harness
- Add missing unit test for HTMLPurifier::getInstance

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1358 48356398-32a2-884e-a903-53898d9a118a
2007-08-03 15:11:08 +00:00
Edward Z. Yang
a40e16dd2e [2.1.0] Allow i18n font names
- Minor typos fixed; we're release ready!

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1350 48356398-32a2-884e-a903-53898d9a118a
2007-08-03 02:48:52 +00:00
Edward Z. Yang
f5b72c623c [2.1.0] Implement Ruby.
- Destroy some zombie context variables
- Reorganize some TODO items

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1347 48356398-32a2-884e-a903-53898d9a118a
2007-08-02 22:44:42 +00:00
Edward Z. Yang
7bccc24977 [2.1.0] Implement MakeAbsolute URI filter
- Move some directives with complex dependencies to URIDefinition
- Fix a missing extends
- Add hierarchical information to URI schemes
- Fix bug in URIHarness.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1346 48356398-32a2-884e-a903-53898d9a118a
2007-08-02 21:47:24 +00:00
Edward Z. Yang
25fe416ab2 Add test-case for blank TinyMCE allowed list.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1345 48356398-32a2-884e-a903-53898d9a118a
2007-08-02 15:13:12 +00:00
Edward Z. Yang
22ef52a7f6 [2.1.0] Migrate host blacklist functionality to URIFilter.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1336 48356398-32a2-884e-a903-53898d9a118a
2007-08-02 01:41:37 +00:00
Edward Z. Yang
4919187fc6 [2.1.0] Further refactoring of AttrDef_URI, creation of new URIFilter and URIDefinition subsystems.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1335 48356398-32a2-884e-a903-53898d9a118a
2007-08-02 01:12:27 +00:00
Edward Z. Yang
797b899305 [2.1.0] Create new URI object and migrate URI validation systems to use it. URIScheme interface changed.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1334 48356398-32a2-884e-a903-53898d9a118a
2007-08-01 18:34:46 +00:00
Edward Z. Yang
8c9dbe142d [2.1.0] Refactor AttrDef_URI: removed URIParser functionality
- Genericized flush-definition-cache script

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1333 48356398-32a2-884e-a903-53898d9a118a
2007-08-01 14:55:09 +00:00
Edward Z. Yang
2a002857ce [2.1.0] All unit tests inherit from HTMLPurifier_Harness, not UnitTestCase. prepareCommon() refactored to global test-case.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1332 48356398-32a2-884e-a903-53898d9a118a
2007-08-01 14:06:59 +00:00
Edward Z. Yang
b0f3116b9e [2.1.0] URI scheme is munged off if there is no authority and the scheme is the default one
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1330 48356398-32a2-884e-a903-53898d9a118a
2007-08-01 13:15:33 +00:00
Edward Z. Yang
b03a44abff Remove expectations from assertOutput in URITest.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1329 48356398-32a2-884e-a903-53898d9a118a
2007-08-01 02:19:43 +00:00
Edward Z. Yang
cf257cabde [2.1.0]
- AttrDef_URI unit tests refactored
- Block access to benchmarks: they should be called via command line

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1328 48356398-32a2-884e-a903-53898d9a118a
2007-08-01 01:48:51 +00:00
Edward Z. Yang
349c4de75b [2.1.0] Standalone file now can be generated using maintenance/merge-library.php. Also:
- HTMLPURIFIER_PREFIX constant added, and relevant files transitioned over
- Custom ChildDef added to default include list
- Tester accepts ?standalone parameter

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1316 48356398-32a2-884e-a903-53898d9a118a
2007-07-30 16:56:50 +00:00
Edward Z. Yang
89622c964e [2.1.0] Genericize element contents removal. This is done in a slightly hacky way since ElementDef is not available, but should be sufficient.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1313 48356398-32a2-884e-a903-53898d9a118a
2007-07-11 20:42:58 +00:00
Edward Z. Yang
e7e81c0a5b [2.1.0] Fix some minor DirectLex bugs that may lead to PHP errors
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1310 48356398-32a2-884e-a903-53898d9a118a
2007-07-05 21:29:07 +00:00
Edward Z. Yang
733868a76d [2.1.0] Fix another AutoParagraph edge-case.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1295 48356398-32a2-884e-a903-53898d9a118a
2007-06-29 17:48:56 +00:00
Edward Z. Yang
cff498ef67 [2.1.0] Refine autoparagraphing algorithm.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1278 48356398-32a2-884e-a903-53898d9a118a
2007-06-29 03:57:14 +00:00
Edward Z. Yang
5e5c0f3aa4 [2.1.0]
. Introduce new text/itext configuration directive values: these represent longer strings that would be more appropriately edited with a textarea
. Allow newlines to act as separators for lists, hashes, lookups and %HTML.Allowed

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1272 48356398-32a2-884e-a903-53898d9a118a
2007-06-29 01:54:48 +00:00
Edward Z. Yang
2e7e411491 [2.1.0] Fix bug in auto-paragraphing: empty tags should be treated like start tags too.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1269 48356398-32a2-884e-a903-53898d9a118a
2007-06-29 00:24:59 +00:00
Edward Z. Yang
a96b5bf612 [2.1.0] Friendly error messages for when injector needs a tag that's not allowed added
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1265 48356398-32a2-884e-a903-53898d9a118a
2007-06-28 13:06:15 +00:00
Edward Z. Yang
a6ede3804e [2.1.0] True emoticon < fix.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1260 48356398-32a2-884e-a903-53898d9a118a
2007-06-27 16:40:18 +00:00
Edward Z. Yang
e99520ab96 Remove trailing ?> in PHP library files, add trailing newlines to all other files.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1253 48356398-32a2-884e-a903-53898d9a118a
2007-06-27 13:58:32 +00:00
Edward Z. Yang
3a1d505b3d [2.0.1] Implement haphazard error collection for AttrValidator.
- Error collector / Language can take arrays and listify them
- AttrValidator takes token by reference
- Formatted errors now have their severity <strong>
- 100 test-cases! W00t!

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1250 48356398-32a2-884e-a903-53898d9a118a
2007-06-27 02:03:15 +00:00
Edward Z. Yang
a005da8a4c [2.0.1] Add error messages for FixNesting
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1249 48356398-32a2-884e-a903-53898d9a118a
2007-06-26 23:43:28 +00:00
Edward Z. Yang
6a95d91a1a [2.0.1] Revamp error collector scheme: we now have custom mocks and an exchange of responsibilities
- Fix oversight in AutoParagraph dealing with armor.
- Order errors with no line number last
- Language object now needs $config and $context objects to do parameterized objects
- Auto-close notice added
- Token constructors accept line numbers

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1245 48356398-32a2-884e-a903-53898d9a118a
2007-06-26 19:33:37 +00:00
Edward Z. Yang
275932ec05 [2.0.1] Fix DirectLex's incomprehension of un-armored script contents as CDATA using custom preg_replace_callback
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1244 48356398-32a2-884e-a903-53898d9a118a
2007-06-26 16:08:42 +00:00
Edward Z. Yang
ae90bb919d Remove unnecessary $this parameters from mock instantiation; SimpleTest doesn't use it!
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1243 48356398-32a2-884e-a903-53898d9a118a
2007-06-26 15:40:04 +00:00
Edward Z. Yang
3c734b4c72 [2.0.1] Implement error messages for MakeWellFormed. Armor AutoParagraph generated p start tags from these tag closing errors. Fix another auto-paragraphing edge-case. Create common Strategy error harness.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1242 48356398-32a2-884e-a903-53898d9a118a
2007-06-26 15:07:07 +00:00
Edward Z. Yang
3d02a2a7d4 Remove magic quotes test: it fails in systems that have magic quotes disabled.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1241 48356398-32a2-884e-a903-53898d9a118a
2007-06-26 03:34:29 +00:00
Edward Z. Yang
0bfa42f9b7 Downgrade comment removal error to E_NOTICE.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1240 48356398-32a2-884e-a903-53898d9a118a
2007-06-26 03:22:07 +00:00
Edward Z. Yang
7a8edc88f9 [2.0.1] Implement error collection for RemoveForeignElements.
- Register Generator context variable.
- Implement special substitutions for error collector.
- Also sort by order the errors came in.
- Fix line number determination bug in Lexer::create().
- Remove vestigial variables.
- Force all tag transforms to use copy(), implement serialize, unserialize algorithm for copy() in tokens.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1238 48356398-32a2-884e-a903-53898d9a118a
2007-06-26 02:49:21 +00:00
Edward Z. Yang
6f5592ae60 [2.0.1] Normalize newlines to \n for internal processing.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1235 48356398-32a2-884e-a903-53898d9a118a
2007-06-25 19:18:55 +00:00
Edward Z. Yang
9f996b125a [2.0.1]
- Printer adheres to configuration's directives on output format
- Fix improperly named form field in ConfigForm printer
. HTMLPurifier_Config::getAllowedDirectivesForForm implemented, allows much easier selective embedding of configuration values
. Doctype objects now accept public and system DTD identifiers
. %HTML.Doctype is now constrained by specific values, to specify a custom doctype use new %HTML.CustomDoctype
. ConfigForm truncates long directives to keep the form small, and does not re-output namespaces

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1232 48356398-32a2-884e-a903-53898d9a118a
2007-06-25 18:38:39 +00:00
Edward Z. Yang
0e9904a9ba Factor out DirectLex error testing to its own class.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1230 48356398-32a2-884e-a903-53898d9a118a
2007-06-25 01:56:00 +00:00
Edward Z. Yang
e66a98c396 [2.0.1] Convert test language messages to use new format.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1229 48356398-32a2-884e-a903-53898d9a118a
2007-06-25 01:11:56 +00:00
Edward Z. Yang
728088f2ba [2.0.1] Rather than pass line number by parameter, have it be retrieved via Context. Add $ignore_error boolean to get().
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1228 48356398-32a2-884e-a903-53898d9a118a
2007-06-25 01:08:57 +00:00
Edward Z. Yang
8ae2604440 [2.0.1] Start making more moves towards full error reporting. Revise message naming conventions. Fix variable assignment for error collecting. Revise Language interface to be as readable as possible (NOT compact). Add error reporting to DirectLex. Rewrite ErrorCollector.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1227 48356398-32a2-884e-a903-53898d9a118a
2007-06-25 00:48:26 +00:00
Edward Z. Yang
7b087c7bbe [2.0.1] Add severity to error collector
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1226 48356398-32a2-884e-a903-53898d9a118a
2007-06-24 23:20:35 +00:00
Edward Z. Yang
58064592ff [2.0.1]
- Stray xmlns attributes removed from configuration documentation
. Interlinking in configuration documentation added using Injector_PurifierLinkify
. Directives now keep track of aliases to themselves

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1225 48356398-32a2-884e-a903-53898d9a118a
2007-06-24 22:22:00 +00:00
Edward Z. Yang
b19fc32a5a Genericize Injector loading code, create new AutoFormatParam namespace, move out unit tests.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1224 48356398-32a2-884e-a903-53898d9a118a
2007-06-24 21:35:34 +00:00
Edward Z. Yang
b15cbbb42a [2.0.1] Officially add experimental auto-paragraphing and linkification functionality. Rename %Core.DefinitionCache to %Cache.DefinitionImpl. Have AutoParagraph handle even more edge cases. Fix MakeWellFormed bug.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1223 48356398-32a2-884e-a903-53898d9a118a
2007-06-24 20:29:50 +00:00
Edward Z. Yang
5f0663cad7 Refactor MakeWellFormed/Injector for performance and as little code duplication as possible. Also, make AutoParagraph smarter about root nodes that don't like p tags.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1221 48356398-32a2-884e-a903-53898d9a118a
2007-06-24 17:44:27 +00:00
Edward Z. Yang
75e52a12a6 Make context errors more friendly; factor out disabled; fix broken test cases; update TODO.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1220 48356398-32a2-884e-a903-53898d9a118a
2007-06-24 04:22:28 +00:00
Edward Z. Yang
269268b843 Fix possible infinite loop by incrementing everybody's offsets. Add printTokens debugger function. Refine Linkify parent node checks (also check excludes, although technically later steps will catch it!)
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1218 48356398-32a2-884e-a903-53898d9a118a
2007-06-24 03:34:33 +00:00
Edward Z. Yang
62c6d93b6d Add more unit tests; everything seems to be good, but I'm suspicious.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1217 48356398-32a2-884e-a903-53898d9a118a
2007-06-24 02:59:06 +00:00
Edward Z. Yang
e5191b3ada [2.0.1] Scrap auto_close in favor of ChildDef->elements heuristic.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1213 48356398-32a2-884e-a903-53898d9a118a
2007-06-23 20:52:57 +00:00
Edward Z. Yang
5d0a992579 Refactor Injector not to edit $result directly.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1212 48356398-32a2-884e-a903-53898d9a118a
2007-06-23 19:39:03 +00:00
Edward Z. Yang
dc0fb7d2b4 [2.0.1] DefinitionCache related bug-fixes
- Fixed bug where manually modified definitions were not saved via cache (mostly harmless, except for the fact that it would be a little slower)
- Configuration objects with different serials do not clobber each others when revision numbers are unequal
. DefinitionCache keys reordered to reflect precedence: version number, hash, then revision number

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1204 48356398-32a2-884e-a903-53898d9a118a
2007-06-23 14:05:09 +00:00
Edward Z. Yang
eee45fed37 [2.0.1] Add preliminary auto-paragraph implementation. It needs to be aggressively refactored and generalized.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1202 48356398-32a2-884e-a903-53898d9a118a
2007-06-22 21:32:56 +00:00
Edward Z. Yang
b10a380ff4 [2.0.1] Rewire test-cases to swallow errors, not expect them
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1190 48356398-32a2-884e-a903-53898d9a118a
2007-06-21 15:15:02 +00:00
Edward Z. Yang
bf0d659c47 [2.0.1] Improve special case handling for <script>
- DirectLex now honors comments with greater than or less than signs in them
- Comments are transformed into script elements, ending comments are scrapped
- Buggy generator code rewritten to be more error-proof
- AttrValidator checks if token has attributes before processing
- Remove invalid documentation from Scripting
- "Commenting" of script elements switched to the more advanced version

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1189 48356398-32a2-884e-a903-53898d9a118a
2007-06-21 14:44:26 +00:00
Edward Z. Yang
69996acc9e [1.7.0] Add native support for required elements
- Factored out large portion of ValidateAttributes to AttrValidator
- Implemented ValidateAttributes armor
- Fix clear cache bug
- Implement armoring for ValidateAttributes

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1174 48356398-32a2-884e-a903-53898d9a118a
2007-06-20 21:39:28 +00:00
Edward Z. Yang
8bbb73e47d [1.7.0] ChildDef_Custom's regex generation has been improved, removing several false positives
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1173 48356398-32a2-884e-a903-53898d9a118a
2007-06-20 15:54:50 +00:00
Edward Z. Yang
da2ea348fd [1.7.0] Change ->Revision member variable to a legit configuration directive. Start writing tutorial for customization.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1171 48356398-32a2-884e-a903-53898d9a118a
2007-06-20 02:43:43 +00:00
Edward Z. Yang
d399abba50 [1.7.0] Bug resulting from tag transforms to non-allowed elements fixed
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1169 48356398-32a2-884e-a903-53898d9a118a
2007-06-19 22:10:39 +00:00
Edward Z. Yang
0b0a505c30 [1.7.0] Implement addElement: the advanced API is complete!
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1165 48356398-32a2-884e-a903-53898d9a118a
2007-06-19 01:55:31 +00:00
Edward Z. Yang
6aa3dfc116 [1.7.0] Implement addAttribute() of advanced API.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1164 48356398-32a2-884e-a903-53898d9a118a
2007-06-19 01:29:50 +00:00
Edward Z. Yang
220c150e0a [1.7.0] StrictBlockquote child definition refrains from wrapping whitespace in tags now.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1159 48356398-32a2-884e-a903-53898d9a118a
2007-06-18 19:53:46 +00:00
Edward Z. Yang
0e5491b20c [1.7.0] Wire in Language and ErrorCollector to main class, now, the only thing to do is actually implement the stuff
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1157 48356398-32a2-884e-a903-53898d9a118a
2007-06-18 03:05:18 +00:00
Edward Z. Yang
7699efd593 Implement bare minimum extra functions for language implementation.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1156 48356398-32a2-884e-a903-53898d9a118a
2007-06-18 02:25:27 +00:00
Edward Z. Yang
4bf15de536 [1.7.0] Implement line number counting in DirectLex, in preparation for error reporting
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1155 48356398-32a2-884e-a903-53898d9a118a
2007-06-18 02:01:01 +00:00
Edward Z. Yang
d1f43636e5 [1.7.0] DefinitionCache->flush() now requires configuration object. DefinitionCache_Serializer now will create directories for new types on the fly, and can accept custom directories to save serials into.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1147 48356398-32a2-884e-a903-53898d9a118a
2007-06-16 20:46:44 +00:00
Edward Z. Yang
9c7483166c [1.7.0] Add DefinitionID for HTML, to prevent caching conflicts with custom-edited definition objects. Also, more user friendly error messages from Config.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1146 48356398-32a2-884e-a903-53898d9a118a
2007-06-16 20:21:00 +00:00
Edward Z. Yang
e840564228 [1.7.0] Contents between <script> tags are now completely removed if <script> is not allowed
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1145 48356398-32a2-884e-a903-53898d9a118a
2007-06-16 19:31:45 +00:00
Edward Z. Yang
12f73605a3 [1.7.0] Implement HTML.Allowed, a TinyMCE style whitelist format.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1119 48356398-32a2-884e-a903-53898d9a118a
2007-05-29 21:26:43 +00:00
Edward Z. Yang
e2a951420f [1.7.0] Implement Cleanup decorator
- Create generic DecoratorHarness
- Name decorators, so that they can be overridden or removed
- Add setup function to definition cache factory

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1118 48356398-32a2-884e-a903-53898d9a118a
2007-05-29 20:49:33 +00:00
Edward Z. Yang
002395de09 [1.7.0] Add DefinitionCache decorators, implement Memory decorator
- Move serialization responsibility to Config
- Create DefinitionCacheFactory
- Implement Null definition cache

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1117 48356398-32a2-884e-a903-53898d9a118a
2007-05-29 20:21:33 +00:00
Edward Z. Yang
d1187ed331 [1.7.0] Add versioning to serializer cache
- Make some AttrDef member-variables lazy-loading to save serialization space, clean up others
- Refactor get*Definition() methods

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1116 48356398-32a2-884e-a903-53898d9a118a
2007-05-29 18:19:42 +00:00
Edward Z. Yang
426fbd1f97 [1.7.0] Complete Legacy element and attribute native support.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1115 48356398-32a2-884e-a903-53898d9a118a
2007-05-29 16:51:32 +00:00
Edward Z. Yang
dea62ffdab - Modify hash format to be more intuitive
- Add parameter that controls magic quotes processing in loadArrayFromForm

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1107 48356398-32a2-884e-a903-53898d9a118a
2007-05-28 03:55:36 +00:00
Edward Z. Yang
bd8ecdd268 Rewire test runner to use full path to test file, this means we can introduce new namespaces.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1102 48356398-32a2-884e-a903-53898d9a118a
2007-05-28 02:29:48 +00:00
Edward Z. Yang
ef51f8681a [1.7.0] Create ConfigForm printer classes
- Extend hash to convert strings from form key,value,key,value
- Hack up configdoc to accommodate configForm.php smoketest

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1101 48356398-32a2-884e-a903-53898d9a118a
2007-05-28 02:20:55 +00:00
Edward Z. Yang
ee61ffc0d9 Minor test-case refactoring.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1100 48356398-32a2-884e-a903-53898d9a118a
2007-05-27 23:12:17 +00:00
Edward Z. Yang
f758f7c534 Oh whitespace how I despise you! Fix whitespace discrepancies between DOM and DirectLex.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1099 48356398-32a2-884e-a903-53898d9a118a
2007-05-27 16:17:14 +00:00
Edward Z. Yang
95499e34da Factor out common DefinitionCache test code to a harness.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1098 48356398-32a2-884e-a903-53898d9a118a
2007-05-27 15:52:45 +00:00
Edward Z. Yang
de23201cbb [1.7.0] HTML Purifier now works with PHP 4.3.2. Yay!
- Armor some character index checking
- Add compatibility stuff for PHP_EOL
- Add autoclose for colgroup
- Compensate for realpath() quirkiness in old versions
- Add flush maintenance script

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1096 48356398-32a2-884e-a903-53898d9a118a
2007-05-27 14:27:54 +00:00
Edward Z. Yang
21ab12a6a8 [1.7.0] Add missing functions for DefinitionCache: replace, flush and type-checking
- Add version to configuration object, and have update script change it accordingly

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1095 48356398-32a2-884e-a903-53898d9a118a
2007-05-27 13:25:54 +00:00
Edward Z. Yang
fa05319e30 [1.7.0] Factor out caching of definitions to DefinitionCache, hook in CSS, add a bunch of todos for this functionality. Attr namespace no longer affects HTMLDefinition.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1093 48356398-32a2-884e-a903-53898d9a118a
2007-05-25 01:32:29 +00:00
Edward Z. Yang
ea46d79b0a Add missing parent class Definition.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1092 48356398-32a2-884e-a903-53898d9a118a
2007-05-24 22:08:29 +00:00
Edward Z. Yang
a62f8971e4 [1.7.0] Refactor HTMLDefinition and CSSDefinition to have a common Definition parent, rename setup() to doSetup() and make setup() call the template method after setting the setup variable. Test for references in ConfigTest.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1091 48356398-32a2-884e-a903-53898d9a118a
2007-05-24 21:50:43 +00:00
Edward Z. Yang
e180b7689e [1.7.0] Implement HTMLDefinition cache (very hacked together, but long unit test times were driving me crazy!)
- Add extra protection in AttrDef_URI against phantom Schemes
- Doctype moved from config to HTMLDefinition
- AttrDef_URITest mocks have more generic object parameters to deal with PHP4's copy-happy behavior

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1089 48356398-32a2-884e-a903-53898d9a118a
2007-05-23 03:27:36 +00:00
Edward Z. Yang
7579932948 [1.7.0] New compact syntax for AttrDef objects that can be used to instantiate new objects via make()
- Implemented make() for Enum and Bool
- Migrate classes over to this new syntax
- Add AttrDef_HTML_Bool unit test

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1088 48356398-32a2-884e-a903-53898d9a118a
2007-05-23 00:39:07 +00:00
Edward Z. Yang
818d0d7a23 [1.7.0] Add missing includes for AttrTypes, add phantom unit test for future things to come
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1087 48356398-32a2-884e-a903-53898d9a118a
2007-05-22 23:48:38 +00:00
Edward Z. Yang
797d3e0393 [1.7.0] Rewire dependencies, removing redundant includes and adding necessary ones
- Rework descendants_are_inline to have default value as false, ins/del handling now works top-level when parent element is not block
- Remove CleanUTF8OnGeneration, feature didn't even work

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1086 48356398-32a2-884e-a903-53898d9a118a
2007-05-22 00:47:03 +00:00
Edward Z. Yang
0ea04db559 [1.7.0] Finish implementing legacy elements, begin implementing legacy attributes
- Migrated most unit tests over to XHTML 1.0 Strict to preserve transformation behavior
- Created %Core.ColorKeywords to be shared between CSS_Color and HTML_Color
- Added AttrDef_HTML_Color as AttrType Color
- HTMLPurifier_Config::create(HTMLPurifier_Config $config) now clones the object
- Attribute minimization for HTML implemented in Generator
- Move div@align fix from proprietary to regular set
- Color keywords now map to full six digit hexadecimal codes
- Harness will now tack on per-use-case configuration

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1084 48356398-32a2-884e-a903-53898d9a118a
2007-05-21 01:36:15 +00:00
Edward Z. Yang
831db14c79 [1.7.0] Remove HTMLModule tests. They were a bad idea.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1083 48356398-32a2-884e-a903-53898d9a118a
2007-05-21 00:24:32 +00:00
Edward Z. Yang
a470fc5621 [1.7.0] Refactor HTMLModule unit tests
- AttrCollections does not barf when an inclusion is not present
- HTMLDefinition configuration directives now use new syntax
- Added %HTML.AllowedModules and %HTML.CoreModules for testing
- Extend Harness so that it can accept a default configuration object member variable
- Refactor modules to use Scaffolding, which defines some custom attributes that allows for the easy testing of attribute collections

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1082 48356398-32a2-884e-a903-53898d9a118a
2007-05-20 22:29:31 +00:00
Edward Z. Yang
2945f6a930 [1.7.0] Implement u, s, and strike tag transforms
- Extend Simple so that it can accept some light CSS
- Remove Center transform in favor of Simple

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1081 48356398-32a2-884e-a903-53898d9a118a
2007-05-20 21:22:54 +00:00
Edward Z. Yang
3f06d8316c [1.7.0] Add unit test for AttrCollections
- Fixed bug where recursive attribute collections would result in infinite loop
- Fixed bug with deep inclusions in attribute collections
- Reset doctype object if HTML or Attr is changed
- Add accessor functions to AttrTypes, unit tested class

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1077 48356398-32a2-884e-a903-53898d9a118a
2007-05-20 19:29:05 +00:00
Edward Z. Yang
9728be4a52 [1.7.0] Configuration object now finalizes itself after first read operation
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1075 48356398-32a2-884e-a903-53898d9a118a
2007-05-20 18:06:51 +00:00
Edward Z. Yang
4d38c02932 [1.7.0] Implement and hook-in Tidy module setup.
- CommonAttributes factored into XMLCommonAttributes and NonXMLCommonAttributes
- Tidy abstract module was completely refactored in interest of usability
- Add friendly error message if module does not have name

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1070 48356398-32a2-884e-a903-53898d9a118a
2007-05-19 21:00:12 +00:00
Edward Z. Yang
83a50465dc [1.7.0] Commit abstract implementation of Tidy module: migration to follow.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1069 48356398-32a2-884e-a903-53898d9a118a
2007-05-19 01:42:17 +00:00
Edward Z. Yang
a5136b65e4 [1.7.0] Eliminated modes in favor for special-case "Tidy" modules
- Add $xml property to Doctype, make more serialize friendly in preparation for stuffing into Config object
- Add FIXME markers for areas of further development, code is hooked so this is easy
- Document what the new Tidy classes will be

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1065 48356398-32a2-884e-a903-53898d9a118a
2007-05-16 03:00:18 +00:00
Edward Z. Yang
831a09d455 [1.7.0] Various updates
- Implement addModule(), requires new userModules property
- Remove unnecessary $config passing for getElement(s)
- Revamp HTMLModuleManagerTest
- Fix buggy unit test for unrecognized parent
- Remove anonymous generator member variable from ChildDef_Required

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1063 48356398-32a2-884e-a903-53898d9a118a
2007-05-15 02:33:19 +00:00
Edward Z. Yang
f7eccc0038 [1.7.0] Add %HTML.Trusted directive to allow untrusted elements in. Add special-case code for <script> into Generator.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1061 48356398-32a2-884e-a903-53898d9a118a
2007-05-15 01:17:10 +00:00
Edward Z. Yang
6b9c5ec603 [1.7.0] Implement DoctypeRegistry. Add transparent constructor to Doctype.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1059 48356398-32a2-884e-a903-53898d9a118a
2007-05-14 22:36:35 +00:00
Edward Z. Yang
05e1aca2fa [1.7.0] Begin refactoring of HTMLModuleManager, a lot of vestigal code remaining, but basic transferral to decentralized safety design finished. Enable scripting module.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1053 48356398-32a2-884e-a903-53898d9a118a
2007-05-14 00:14:21 +00:00
Edward Z. Yang
23feb457f2 [1.7.0] Drastically reorganize TransformToStrict, attributes now ordered alphabetically and are commented
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1052 48356398-32a2-884e-a903-53898d9a118a
2007-05-13 21:46:10 +00:00
Edward Z. Yang
3b1c40b2fc [1.7.0] Add some module unit tests for Edit, Hypertext, Image and Legacy (incomplete). Remove redundant img scaffolding.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1050 48356398-32a2-884e-a903-53898d9a118a
2007-05-13 20:43:38 +00:00
Edward Z. Yang
da92cb9ff4 [1.7.0] Fix bug in HTMLPurifier_Harness that causes certain aspects of $input to change after parsing
- Add makeLookup() convenience function to HTMLModule
- Relocate SGML exclusion comment
- Add preliminary Bdo module test

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1049 48356398-32a2-884e-a903-53898d9a118a
2007-05-13 03:42:09 +00:00
Edward Z. Yang
bda9167423 [1.7.0] Modify behavior of ElementDef->mergeIn to also merge safe property, this means default is now null.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1048 48356398-32a2-884e-a903-53898d9a118a
2007-05-12 21:47:03 +00:00
Edward Z. Yang
cb9c96a2b0 [1.7.0] Implement addBlankElement for non-standalone elements.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1047 48356398-32a2-884e-a903-53898d9a118a
2007-05-12 20:54:55 +00:00
Edward Z. Yang
e0cf214c44 [1.7.0] Modify addElement to return a reference to the created definition, shorten other HTMLModules accordingly.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1046 48356398-32a2-884e-a903-53898d9a118a
2007-05-12 20:44:47 +00:00
Edward Z. Yang
ed73fdd5b8 [1.7.0] Convert table module to new format. Add support for literal object $contents variable.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1045 48356398-32a2-884e-a903-53898d9a118a
2007-05-12 20:26:26 +00:00
Edward Z. Yang
7f39e1e2c3 [1.7.0] Convert Image, Legacy and List to use new format.
- Make attribute array parameter optional
- Optimize contents parsing for keywords

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1041 48356398-32a2-884e-a903-53898d9a118a
2007-05-09 22:01:07 +00:00
Edward Z. Yang
b81fb0af90 [1.7.0] Add more convenience functions to HTMLModule, wire Edit and Hypertext to use new functionality
- Added LanguageCode to AttrTypes. We should prefer string representations of attribute definitions.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1040 48356398-32a2-884e-a903-53898d9a118a
2007-05-08 03:28:58 +00:00
Edward Z. Yang
47fe34ad81 [1.7.0] Create convenience functions for HTMLModule constructors, HTMLModule_Bdo was hooked up
- Add initial "safe" property for elements, is not set for most though

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1039 48356398-32a2-884e-a903-53898d9a118a
2007-05-07 01:51:26 +00:00
Edward Z. Yang
ac50d333a5 [1.7.0] Unit test for ElementDef created, ElementDef behavior modified to be more flexible
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1038 48356398-32a2-884e-a903-53898d9a118a
2007-05-07 00:38:23 +00:00
Edward Z. Yang
c5e33416d3 [1.6.1] Unit tests now use exclusively assertIdentical
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1024 48356398-32a2-884e-a903-53898d9a118a
2007-05-05 20:17:04 +00:00
Edward Z. Yang
b1822bb04f [1.6.1] Implement AttrTransform for type in ul, ol and li
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1022 48356398-32a2-884e-a903-53898d9a118a
2007-05-05 19:13:52 +00:00
Edward Z. Yang
893e962890 [1.6.1] Update unit tests for font transformation
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1021 48356398-32a2-884e-a903-53898d9a118a
2007-05-05 18:59:24 +00:00
Edward Z. Yang
92ea74cba2 [1.6.1] Add attribute transformation smoketests
- Repair broken noshade implementation
- Add lots of advisory comments to TransformToStrict.php

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1019 48356398-32a2-884e-a903-53898d9a118a
2007-05-05 18:41:53 +00:00
Edward Z. Yang
a01459c87a [1.6.1] Implement clear in br and align in caption, table, img and hr
- Refactored ValidateAttributesTest.php

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1018 48356398-32a2-884e-a903-53898d9a118a
2007-05-05 16:18:04 +00:00
Edward Z. Yang
fd35c43643 [1.6.1] Implement generic EnumToCSS attribute transformation, migrate text alignment to it
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1017 48356398-32a2-884e-a903-53898d9a118a
2007-05-05 15:48:41 +00:00
Edward Z. Yang
0426985c81 [1.6.1] Refactor AttrTransform to reduce duplication.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1016 48356398-32a2-884e-a903-53898d9a118a
2007-05-05 02:25:55 +00:00
Edward Z. Yang
4e77a1adbd [1.6.1] Fix fatal error with XHTML 1.1 validation.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1013 48356398-32a2-884e-a903-53898d9a118a
2007-05-04 01:17:00 +00:00
Edward Z. Yang
bd58a7ba77 [1.6.1] Implement BoolToCSS attribute transformations for td,th.nowrap and hr.noshade
- Implement CSS property white-space:nowrap;
- Update TODO with more ambitious goal: all transforms by 1.6.1

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1012 48356398-32a2-884e-a903-53898d9a118a
2007-05-03 04:07:47 +00:00
Edward Z. Yang
234b3085d7 [1.6.1] Activate transform for hr.size
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1006 48356398-32a2-884e-a903-53898d9a118a
2007-05-01 21:36:19 +00:00
Edward Z. Yang
3d978c961d [1.6.1] Implement target module/attribute.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1002 48356398-32a2-884e-a903-53898d9a118a
2007-04-30 21:19:15 +00:00
Edward Z. Yang
72254cd77a [1.6.1] Implement vspace and hspace transformations in img.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1001 48356398-32a2-884e-a903-53898d9a118a
2007-04-30 19:39:42 +00:00
Edward Z. Yang
d8a6361244 [1.6.1] Empty strings get converted to empty arrays instead of arrays with an empty string in them.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1000 48356398-32a2-884e-a903-53898d9a118a
2007-04-30 01:14:21 +00:00
Edward Z. Yang
968dfa2feb [1.6.1] Fix broken configuration directive %Core.RemoveInvalidImg, also make basic demo operational out-of-the-box
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@999 48356398-32a2-884e-a903-53898d9a118a
2007-04-30 00:53:13 +00:00
Edward Z. Yang
ac3ab2a556 [1.6.1] DirectLex now preserves text in which a < bracket is followed by a non-alphanumeric character. This means that certain emoticons are now preserved.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@939 48356398-32a2-884e-a903-53898d9a118a
2007-04-04 02:22:27 +00:00
Edward Z. Yang
b15e8c344e [1.6.0] Implement ID regexp matching.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@926 48356398-32a2-884e-a903-53898d9a118a
2007-03-31 03:25:10 +00:00
Edward Z. Yang
e2c3394d70 [1.6.0] Add support for LinkTypes, used for rel and rev attributes.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@924 48356398-32a2-884e-a903-53898d9a118a
2007-03-31 02:58:16 +00:00
Edward Z. Yang
058f1eba7d [1.6.0] Implement width/height attribute transforms with Length.php
- Also, enabled 'height' CSS attribute

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@922 48356398-32a2-884e-a903-53898d9a118a
2007-03-29 23:48:54 +00:00
Edward Z. Yang
1102dc6e27 [1.6.0] Add support for name transformation to id
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@921 48356398-32a2-884e-a903-53898d9a118a
2007-03-29 23:19:53 +00:00
Edward Z. Yang
85374d330f [1.6.0] Add support for border attribute transform
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@920 48356398-32a2-884e-a903-53898d9a118a
2007-03-29 21:41:17 +00:00
Edward Z. Yang
a16d6c4342 [1.6.0] Add support for bgcolor attribute transform.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@919 48356398-32a2-884e-a903-53898d9a118a
2007-03-29 21:20:44 +00:00
Edward Z. Yang
0167f8aa84 [1.5.1] Try separating out declarations, might stop segfaulting.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@911 48356398-32a2-884e-a903-53898d9a118a
2007-03-27 23:15:01 +00:00
Edward Z. Yang
f1a90e684b [1.5.1] Separate out trouble area that's having segfaults. (note: this commit actually inadvertently let us discover a fix for the segfault, applied in the next revision).
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@910 48356398-32a2-884e-a903-53898d9a118a
2007-03-27 23:07:21 +00:00
Edward Z. Yang
17d32bac7f Almost release 1.5.0. Merged in a few strict changes.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@870 48356398-32a2-884e-a903-53898d9a118a
2007-03-24 01:24:38 +00:00
Edward Z. Yang
4169846c57 Modules are not passed by reference, so in PHP 4 we cannot guarantee same module that went in will be used.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@767 48356398-32a2-884e-a903-53898d9a118a
2007-02-27 23:57:54 +00:00
Edward Z. Yang
9a99750474 - Setup doctypes, auto properties, and work on making the interface more user-friendly
- Yet even more unit test for HTMLModuleManager
- Sample code in printDefinition for defining a new element
- Downgraded importances of HTMLModule->elements

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@762 48356398-32a2-884e-a903-53898d9a118a
2007-02-18 05:29:19 +00:00
Edward Z. Yang
7eb751b5f5 More refactoring: for interest of unit testing, default doctypes were moved to an initialize() method which could optionally be omitted. Disable collection aliases in favor of doctype aliases.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@761 48356398-32a2-884e-a903-53898d9a118a
2007-02-17 22:17:14 +00:00