mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-22 16:31:53 +00:00
Hook in URI to Definition. Update progress documents.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@220 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
4193fd018a
commit
4fe9d943e8
10
TODO.txt
10
TODO.txt
@ -1,15 +1,13 @@
|
||||
Todo List
|
||||
|
||||
Primary:
|
||||
- (In Progress) Implement attribute validation
|
||||
- Implement HTMLPurifier (trivial)
|
||||
|
||||
Code issues:
|
||||
- Rename AbstractTest to Harness
|
||||
- (?) Create a TokenFactory to prevent really long lines
|
||||
- Massive profiling
|
||||
- Fix IPv6 issues
|
||||
- Make URI validation routines tighter
|
||||
- Make URI validation routines tighter (especially mailto)
|
||||
- Distinguish between different types of URIs, for instance, a mailto URI
|
||||
in IMG SRC is nonsensical
|
||||
- Factor out Host validation to its own AttrDef
|
||||
|
||||
Enhancements:
|
||||
- Do fixes for Firefox's inability to handle COL alignment props (Bug 915)
|
||||
|
@ -71,7 +71,7 @@ thead th {text-align:left;padding:0.1em;background-color:#EEE;}
|
||||
<tr><td>scope</td><td>TD, TH</td><td>W3C only: No browser implementation</td></tr>
|
||||
</tbody>
|
||||
|
||||
<tbody>
|
||||
<tbody class="impl-yes">
|
||||
<tr><th colspan="3">URI</th></tr>
|
||||
<tr><td rowspan="2">cite</td><td>BLOCKQUOTE, Q</td><td>-</td></tr>
|
||||
<tr><td>DEL, INS</td><td>-</td></tr>
|
||||
@ -103,6 +103,7 @@ thead th {text-align:left;padding:0.1em;background-color:#EEE;}
|
||||
<tr><td>noshade</td><td>HR</td><td>Boolean, style 'border-style:solid;'</td></tr>
|
||||
<tr><td>nowrap</td><td>TD, TH</td><td>Boolean, style 'white-space:nowrap;' (not compat with IE5)</td></tr>
|
||||
<tr><td>size</td><td>HR</td><td>Near-equiv 'width', needs px suffix if original was pixels</td></tr>
|
||||
<tr><td>src</td><td>IMG</td><td>Required, insert blank or default img if not set</td></tr>
|
||||
<tr><td>start</td><td>OL</td><td>Poorly supported 'counter-reset', transform may not be desirable</td></tr>
|
||||
<tr><td rowspan="3">type</td><td>LI</td><td rowspan="3">Equivalent style 'list-style-type', different allowed values though. (needs testing)</td></tr>
|
||||
<tr><td>OL</td></tr>
|
||||
|
@ -10,6 +10,7 @@ require_once 'HTMLPurifier/AttrDef.php';
|
||||
require_once 'HTMLPurifier/AttrDef/Length.php';
|
||||
require_once 'HTMLPurifier/AttrDef/MultiLength.php';
|
||||
require_once 'HTMLPurifier/AttrDef/NumberSpan.php';
|
||||
require_once 'HTMLPurifier/AttrDef/URI.php';
|
||||
require_once 'HTMLPurifier/AttrTransform.php';
|
||||
require_once 'HTMLPurifier/AttrTransform/Lang.php';
|
||||
require_once 'HTMLPurifier/AttrTransform/TextAlign.php';
|
||||
@ -310,6 +311,14 @@ class HTMLPurifier_Definition
|
||||
$this->info['td']->attr['colspan'] =
|
||||
$this->info['th']->attr['colspan'] = $e__NumberSpan;
|
||||
|
||||
$e_URI = new HTMLPurifier_AttrDef_URI();
|
||||
$this->info['a']->attr['href'] =
|
||||
$this->info['img']->attr['longdesc'] =
|
||||
$this->info['img']->attr['src'] =
|
||||
$this->info['del']->attr['cite'] =
|
||||
$this->info['ins']->attr['cite'] =
|
||||
$this->info['blockquote']->attr['cite'] =
|
||||
$this->info['q']->attr['cite'] = $e_URI;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// UNIMP : info_tag_transform : transformations of tags
|
||||
|
@ -87,6 +87,14 @@ class HTMLPurifier_Strategy_ValidateAttributesTest extends
|
||||
HTML;
|
||||
$expect[13] = $inputs[13];
|
||||
|
||||
// test URI
|
||||
$inputs[14] = '<a href="http://www.google.com/">Google</a>';
|
||||
$expect[14] = $inputs[14];
|
||||
|
||||
// test invalid URI
|
||||
$inputs[15] = '<a href="javascript:badstuff();">Google</a>';
|
||||
$expect[15] = '<a>Google</a>';
|
||||
|
||||
$this->assertStrategyWorks($strategy, $inputs, $expect, $config);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user