0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-25 09:41:52 +00:00
Commit Graph

665 Commits

Author SHA1 Message Date
Edward Z. Yang
49fea8f8e9 Begin seperating Lexer implementations by copying the Lexer file to the Lexer directory.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@77 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 00:26:09 +00:00
Edward Z. Yang
a77a720377 Add Lexer folder to separate Lexer implementations.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@76 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 00:22:39 +00:00
Edward Z. Yang
cafa24482d Setup include web. Unit tests should now be able to be run independently.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@75 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 00:13:08 +00:00
Edward Z. Yang
1d8bfebb3a Update todo (rm renaming and refactoring)
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@74 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 00:04:27 +00:00
Edward Z. Yang
025b648c99 Split out code in Definition.php .
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@73 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 00:02:48 +00:00
Edward Z. Yang
f00a80c561 (Test) Branch Definition to ChildDef in order to split out code in the file.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@72 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 00:01:38 +00:00
Edward Z. Yang
6d72d061a9 Branch Definition to AttrDef in order to split out code in the file.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@71 48356398-32a2-884e-a903-53898d9a118a
2006-07-21 23:58:45 +00:00
Edward Z. Yang
fb4efc52bf Branch Definition to ChildDef in order to split out code in the file.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@70 48356398-32a2-884e-a903-53898d9a118a
2006-07-21 23:58:12 +00:00
Edward Z. Yang
404ca68c87 Rename PureHTMLDefinition -> HTMLPurifier_Definition, and internal classes too.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@69 48356398-32a2-884e-a903-53898d9a118a
2006-07-21 23:38:44 +00:00
Edward Z. Yang
436873e227 Move tester, complete HTML_Purifier -> HTMLPurifier move.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@68 48356398-32a2-884e-a903-53898d9a118a
2006-07-21 23:27:00 +00:00
Edward Z. Yang
1836b73c63 HTML_Purifier to HTMLPurifier. May want to rethink schematics for this though.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@67 48356398-32a2-884e-a903-53898d9a118a
2006-07-21 23:13:22 +00:00
Edward Z. Yang
ccebe77e70 Rename HTML_Generator to HTMLPurifier_Generator.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@66 48356398-32a2-884e-a903-53898d9a118a
2006-07-21 23:10:30 +00:00
Edward Z. Yang
6a6afaccc5 Rename HTML_Lexer to HTMLPurifier_Lexer. However, some more refactoring still needs to be done (namely making the lexer an interface).
Also fixed broken benchmarks.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@65 48356398-32a2-884e-a903-53898d9a118a
2006-07-21 23:07:47 +00:00
Edward Z. Yang
cf4776cfbd Add a todo list.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@64 48356398-32a2-884e-a903-53898d9a118a
2006-07-21 11:31:43 +00:00
Edward Z. Yang
23dba8b55e Rename MarkupFragment.php to Token.php, change internal class names and rewire the classes. We also started adding more dependence on the Lexer and Generator in unrelated tests.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@63 48356398-32a2-884e-a903-53898d9a118a
2006-07-21 11:27:54 +00:00
Edward Z. Yang
8bde230c99 Renamed remotely
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@62 48356398-32a2-884e-a903-53898d9a118a
2006-07-21 02:16:36 +00:00
Edward Z. Yang
0ad09e5d94 Commit entity information from the HTML 4.01 spec. This should be parsed into corresponding mapping files, even though they will be versioned.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@61 48356398-32a2-884e-a903-53898d9a118a
2006-07-20 22:47:26 +00:00
Edward Z. Yang
3427c6c079 Begin getting parsing of character data into shape, not done yet.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@60 48356398-32a2-884e-a903-53898d9a118a
2006-07-20 02:43:06 +00:00
Edward Z. Yang
dadfa87acc Update documentation (esp. revamp status)
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@59 48356398-32a2-884e-a903-53898d9a118a
2006-07-20 00:40:04 +00:00
Edward Z. Yang
ff8f24458d Finish implementing fixNesting(). Removed security-in-depth check for optimization reasons, since the info array will never cause such a condition.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@58 48356398-32a2-884e-a903-53898d9a118a
2006-07-20 00:30:35 +00:00
Edward Z. Yang
3e6bcb7a0f Implemented good behavior structure for fixNesting. Goes into infinite loop if bad stuff is passed.
Remove dud test and note which tests need to be added. Also, we're only running one test at a time to ease debugging.

git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@57 48356398-32a2-884e-a903-53898d9a118a
2006-07-19 00:21:21 +00:00
Edward Z. Yang
2a2d8cbd76 Optimize files by removing is_a() calls in favor of static type member variables.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@56 48356398-32a2-884e-a903-53898d9a118a
2006-07-18 23:40:20 +00:00
Edward Z. Yang
5391195170 Finalize fixNesting test suite.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@55 48356398-32a2-884e-a903-53898d9a118a
2006-07-18 23:17:41 +00:00
Edward Z. Yang
06798e60f2 Move Test_HTMLDTD_ChildDef to top for improved organization.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@54 48356398-32a2-884e-a903-53898d9a118a
2006-07-15 20:50:28 +00:00
Edward Z. Yang
fb9ed6f600 In-depth uselessness, have empty element definition return false always.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@53 48356398-32a2-884e-a903-53898d9a118a
2006-06-15 22:08:24 +00:00
Edward Z. Yang
d9c8effc9b Begin fleshing out test_fixNesting(). Still needs more test-cases.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@52 48356398-32a2-884e-a903-53898d9a118a
2006-06-11 22:53:40 +00:00
Edward Z. Yang
e1464fa2f6 Update spec:
* Info about applicability
* Add more status reports
* Add source of XML_DTD code
* Remark about table child definitions

git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@51 48356398-32a2-884e-a903-53898d9a118a
2006-06-05 01:08:20 +00:00
Edward Z. Yang
4935c69904 Main: implemented regexp-style validation for complicated child definitions
Also:
* Updated spec with some extra comments
* Trigger error if HTMLDTD_ChildDef_Simple has validateChildren called
* Factor out definition assertion in test class

git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@50 48356398-32a2-884e-a903-53898d9a118a
2006-06-05 00:50:27 +00:00
Edward Z. Yang
f5486bbbae Add ChildDef_Optional, which piggy-backs off of ChildDef_Required. Some column 80 formatting fixes.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@49 48356398-32a2-884e-a903-53898d9a118a
2006-05-30 22:44:14 +00:00
Edward Z. Yang
3f123d6f53 Fit everything to width=80.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@48 48356398-32a2-884e-a903-53898d9a118a
2006-05-30 14:38:28 +00:00
Edward Z. Yang
e3c4faae41 Add a missing word.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@47 48356398-32a2-884e-a903-53898d9a118a
2006-04-18 02:54:39 +00:00
Edward Z. Yang
c5bcd42d3d Write an introduction to the specification.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@46 48356398-32a2-884e-a903-53898d9a118a
2006-04-18 00:20:51 +00:00
Edward Z. Yang
4d2ec806ac Add a security document, detailing issues that white-listing won't resolve.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@45 48356398-32a2-884e-a903-53898d9a118a
2006-04-17 21:32:53 +00:00
Edward Z. Yang
83f735ea7e Finish HTMLDTD_ChildDef_Required.
Fix bug in HTML_Generator that resulted in attribute-less empty elements to have extra spaces in them.

Add whitespace designation to MF_Text.

git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@44 48356398-32a2-884e-a903-53898d9a118a
2006-04-17 00:49:15 +00:00
Edward Z. Yang
20c53d6017 Add to spec some special cases about exclusions and what to do with invalid data.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@43 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 22:51:34 +00:00
Edward Z. Yang
b29155018b Add a few more comments about possible extra features.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@42 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 21:06:08 +00:00
Edward Z. Yang
8c80b70c37 Implement automatic <p> and <li> closing. We trimmed down the closing P tags list to something more sane in the spec.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@41 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 19:34:28 +00:00
Edward Z. Yang
ffbeaf66d1 Refine tests to include attribute checks and some other cases.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@40 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 16:57:51 +00:00
Edward Z. Yang
eefb08b6f9 PureHTMLDefinition::makeWellFormed() is now complete, but may be missing a few unit tests. Update spec: we need transforms for the foreign elements. PureHTMLDefinition's children definitions have info but not behavior.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@39 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 16:50:51 +00:00
Edward Z. Yang
4c9f4067ab Begin creating scaffolding for the DTD declarations + evaluations that will make up the meat of the rest of the validation. Add a few more forgotten tests for makeWellFormed()
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@38 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 04:07:21 +00:00
Edward Z. Yang
3f4d928173 Add broken test cases for PureHTMLDefinition::makeWellFormed()
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@37 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 03:48:03 +00:00
Edward Z. Yang
0c88b090b0 Add HTML_Generator::generateFromTokens().
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@36 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 03:42:25 +00:00
Edward Z. Yang
1a3887de1b Standardize test-cases with the prefix Test_. Add framework for HTML_Purifier, its unit test will really only be for regression testing from integration issues. It's more important to test the components.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@35 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 03:39:39 +00:00
Edward Z. Yang
69da034570 Fix bug in HTML_Generator that resulted in extra spaces. PureHTMLDefinition now passes all tests.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@34 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 03:33:37 +00:00
Edward Z. Yang
2782d7499a Slightly alter tag hierarchy so that Empty doesn't inherit from Start.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@33 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 03:28:13 +00:00
Edward Z. Yang
7c6775d552 Add HTML_Generator class and associated unit tests.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@32 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 03:27:40 +00:00
Edward Z. Yang
c4b23cc775 Turn on entity parsing for the Lexers. Add PureHTMLDefinition and define removeForeignElements.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@31 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 03:00:05 +00:00
Edward Z. Yang
e7f5b1674d Condense benchmark output.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@30 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 01:09:32 +00:00
Edward Z. Yang
6248b05d0e Peephole optimization for infinite loop protection code.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@29 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 00:37:57 +00:00
Edward Z. Yang
20e027646d Commit benchmarking code.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@28 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 00:35:34 +00:00