mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-15 14:45:57 +00:00
update HTMLPurifier; enable embedded flash video in articles
This commit is contained in:
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Bdo.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Bdo.php
Executable file → Normal file
3
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/CommonAttributes.php
Executable file → Normal file
3
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/CommonAttributes.php
Executable file → Normal file
@@ -8,7 +8,7 @@ class HTMLPurifier_HTMLModule_CommonAttributes extends HTMLPurifier_HTMLModule
|
||||
'Core' => array(
|
||||
0 => array('Style'),
|
||||
// 'xml:space' => false,
|
||||
'class' => 'NMTOKENS',
|
||||
'class' => 'Class',
|
||||
'id' => 'ID',
|
||||
'title' => 'CDATA',
|
||||
),
|
||||
@@ -20,6 +20,7 @@ class HTMLPurifier_HTMLModule_CommonAttributes extends HTMLPurifier_HTMLModule
|
||||
0 => array('Core', 'I18N')
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
// vim: et sw=4 sts=4
|
||||
|
||||
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Edit.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Edit.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Forms.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Forms.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Hypertext.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Hypertext.php
Executable file → Normal file
4
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Image.php
Executable file → Normal file
4
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Image.php
Executable file → Normal file
@@ -11,7 +11,7 @@ class HTMLPurifier_HTMLModule_Image extends HTMLPurifier_HTMLModule
|
||||
public $name = 'Image';
|
||||
|
||||
public function setup($config) {
|
||||
$max = $config->get('HTML', 'MaxImgLength');
|
||||
$max = $config->get('HTML.MaxImgLength');
|
||||
$img = $this->addElement(
|
||||
'img', 'Inline', 'Empty', 'Common',
|
||||
array(
|
||||
@@ -24,7 +24,7 @@ class HTMLPurifier_HTMLModule_Image extends HTMLPurifier_HTMLModule
|
||||
'src*' => new HTMLPurifier_AttrDef_URI(true), // embedded
|
||||
)
|
||||
);
|
||||
if ($max === null || $config->get('HTML', 'Trusted')) {
|
||||
if ($max === null || $config->get('HTML.Trusted')) {
|
||||
$img->attr['height'] =
|
||||
$img->attr['width'] = 'Length';
|
||||
}
|
||||
|
||||
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Legacy.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Legacy.php
Executable file → Normal file
6
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/List.php
Executable file → Normal file
6
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/List.php
Executable file → Normal file
@@ -20,8 +20,10 @@ class HTMLPurifier_HTMLModule_List extends HTMLPurifier_HTMLModule
|
||||
public $content_sets = array('Flow' => 'List');
|
||||
|
||||
public function setup($config) {
|
||||
$this->addElement('ol', 'List', 'Required: li', 'Common');
|
||||
$this->addElement('ul', 'List', 'Required: li', 'Common');
|
||||
$ol = $this->addElement('ol', 'List', 'Required: li', 'Common');
|
||||
$ol->wrap = "li";
|
||||
$ul = $this->addElement('ul', 'List', 'Required: li', 'Common');
|
||||
$ul->wrap = "li";
|
||||
$this->addElement('dl', 'List', 'Required: dt | dd', 'Common');
|
||||
|
||||
$this->addElement('li', false, 'Flow', 'Common');
|
||||
|
||||
5
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Name.php
Executable file → Normal file
5
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Name.php
Executable file → Normal file
@@ -9,7 +9,10 @@ class HTMLPurifier_HTMLModule_Name extends HTMLPurifier_HTMLModule
|
||||
$elements = array('a', 'applet', 'form', 'frame', 'iframe', 'img', 'map');
|
||||
foreach ($elements as $name) {
|
||||
$element = $this->addBlankElement($name);
|
||||
$element->attr['name'] = 'ID';
|
||||
$element->attr['name'] = 'CDATA';
|
||||
if (!$config->get('HTML.Attr.Name.UseCDATA')) {
|
||||
$element->attr_transform_post['NameSync'] = new HTMLPurifier_AttrTransform_NameSync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Module adds the nofollow attribute transformation to a tags. It
|
||||
* is enabled by HTML.Nofollow
|
||||
*/
|
||||
class HTMLPurifier_HTMLModule_Nofollow extends HTMLPurifier_HTMLModule
|
||||
{
|
||||
|
||||
public $name = 'Nofollow';
|
||||
|
||||
public function setup($config) {
|
||||
$a = $this->addBlankElement('a');
|
||||
$a->attr_transform_post[] = new HTMLPurifier_AttrTransform_Nofollow();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// vim: et sw=4 sts=4
|
||||
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Object.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Object.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Presentation.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Presentation.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Proprietary.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Proprietary.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Ruby.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Ruby.php
Executable file → Normal file
5
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeEmbed.php
Executable file → Normal file
5
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeEmbed.php
Executable file → Normal file
@@ -10,7 +10,7 @@ class HTMLPurifier_HTMLModule_SafeEmbed extends HTMLPurifier_HTMLModule
|
||||
|
||||
public function setup($config) {
|
||||
|
||||
$max = $config->get('HTML', 'MaxImgLength');
|
||||
$max = $config->get('HTML.MaxImgLength');
|
||||
$embed = $this->addElement(
|
||||
'embed', 'Inline', 'Empty', 'Common',
|
||||
array(
|
||||
@@ -20,7 +20,8 @@ class HTMLPurifier_HTMLModule_SafeEmbed extends HTMLPurifier_HTMLModule
|
||||
'height' => 'Pixels#' . $max,
|
||||
'allowscriptaccess' => 'Enum#never',
|
||||
'allownetworking' => 'Enum#internal',
|
||||
'wmode' => 'Enum#window',
|
||||
'flashvars' => 'Text',
|
||||
'wmode' => 'Enum#window,transparent,opaque',
|
||||
'name' => 'ID',
|
||||
)
|
||||
);
|
||||
|
||||
6
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeObject.php
Executable file → Normal file
6
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeObject.php
Executable file → Normal file
@@ -16,7 +16,7 @@ class HTMLPurifier_HTMLModule_SafeObject extends HTMLPurifier_HTMLModule
|
||||
// These definitions are not intrinsically safe: the attribute transforms
|
||||
// are a vital part of ensuring safety.
|
||||
|
||||
$max = $config->get('HTML', 'MaxImgLength');
|
||||
$max = $config->get('HTML.MaxImgLength');
|
||||
$object = $this->addElement(
|
||||
'object',
|
||||
'Inline',
|
||||
@@ -28,7 +28,9 @@ class HTMLPurifier_HTMLModule_SafeObject extends HTMLPurifier_HTMLModule
|
||||
'type' => 'Enum#application/x-shockwave-flash',
|
||||
'width' => 'Pixels#' . $max,
|
||||
'height' => 'Pixels#' . $max,
|
||||
'data' => 'URI#embedded'
|
||||
'data' => 'URI#embedded',
|
||||
'codebase' => new HTMLPurifier_AttrDef_Enum(array(
|
||||
'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0')),
|
||||
)
|
||||
);
|
||||
$object->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeObject();
|
||||
|
||||
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Scripting.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Scripting.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/StyleAttribute.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/StyleAttribute.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tables.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tables.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Target.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Target.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Text.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Text.php
Executable file → Normal file
6
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy.php
Executable file → Normal file
6
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy.php
Executable file → Normal file
@@ -42,12 +42,12 @@ class HTMLPurifier_HTMLModule_Tidy extends HTMLPurifier_HTMLModule
|
||||
$this->makeFixesForLevel($fixes);
|
||||
|
||||
// figure out which fixes to use
|
||||
$level = $config->get('HTML', 'TidyLevel');
|
||||
$level = $config->get('HTML.TidyLevel');
|
||||
$fixes_lookup = $this->getFixesForLevel($level);
|
||||
|
||||
// get custom fix declarations: these need namespace processing
|
||||
$add_fixes = $config->get('HTML', 'TidyAdd');
|
||||
$remove_fixes = $config->get('HTML', 'TidyRemove');
|
||||
$add_fixes = $config->get('HTML.TidyAdd');
|
||||
$remove_fixes = $config->get('HTML.TidyRemove');
|
||||
|
||||
foreach ($fixes as $name => $fix) {
|
||||
// needs to be refactored a little to implement globbing
|
||||
|
||||
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Name.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Name.php
Executable file → Normal file
1
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Proprietary.php
Executable file → Normal file
1
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Proprietary.php
Executable file → Normal file
@@ -15,6 +15,7 @@ class HTMLPurifier_HTMLModule_Tidy_Proprietary extends HTMLPurifier_HTMLModule_T
|
||||
$r['thead@background'] = new HTMLPurifier_AttrTransform_Background();
|
||||
$r['tfoot@background'] = new HTMLPurifier_AttrTransform_Background();
|
||||
$r['tbody@background'] = new HTMLPurifier_AttrTransform_Background();
|
||||
$r['table@height'] = new HTMLPurifier_AttrTransform_Length('height');
|
||||
return $r;
|
||||
}
|
||||
|
||||
|
||||
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Strict.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Strict.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/XHTML.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/XHTML.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php
Executable file → Normal file
0
lib/htmlpurifier/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php
Executable file → Normal file
Reference in New Issue
Block a user