From: luci a. l. d' b. <sf...@gr...> - 2011-03-04 09:39:14
|
+0.5 because of introducing the hardcoded: + $conf->set('HTML.Doctype', 'XHTML 1.0 Transitional'); + $conf->set('HTML.TidyLevel', 'light'); (it should respect the value of custom doctype if any) luci On 03/03/2011 09:16 PM, se...@us... wrote: > Revision: 33232 > http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=33232&view=rev > Author: sept_7 > Date: 2011-03-03 20:16:18 +0000 (Thu, 03 Mar 2011) > > Log Message: > ----------- > [FIX/bp 33231] HTMLPurifier : allow <map> tag in page > > Modified Paths: > -------------- > branches/proposals/6.x/lib/core/TikiFilter/HtmlPurifier.php > branches/proposals/6.x/lib/htmlpurifier_tiki/HTMLPurifier.tiki.php > > Modified: branches/proposals/6.x/lib/core/TikiFilter/HtmlPurifier.php > =================================================================== > --- branches/proposals/6.x/lib/core/TikiFilter/HtmlPurifier.php 2011-03-03 20:14:58 UTC (rev 33231) > +++ branches/proposals/6.x/lib/core/TikiFilter/HtmlPurifier.php 2011-03-03 20:16:18 UTC (rev 33232) > @@ -14,12 +14,8 @@ > } > > function filter( $data ) { > - require_once 'lib/htmlpurifier/HTMLPurifier.includes.php'; > + require_once('lib/htmlpurifier_tiki/HTMLPurifier.tiki.php'); > > - $config = HTMLPurifier_Config::createDefault(); > - $config->set( 'Cache', 'SerializerPath', $this->cache ); > - $purifier = new HTMLPurifier($config); > - > - return $purifier->purify( $data ); > + return HTMLPurifier( $data ); > } > } > > Modified: branches/proposals/6.x/lib/htmlpurifier_tiki/HTMLPurifier.tiki.php > =================================================================== > --- branches/proposals/6.x/lib/htmlpurifier_tiki/HTMLPurifier.tiki.php 2011-03-03 20:14:58 UTC (rev 33231) > +++ branches/proposals/6.x/lib/htmlpurifier_tiki/HTMLPurifier.tiki.php 2011-03-03 20:16:18 UTC (rev 33232) > @@ -45,12 +45,51 @@ > } > $conf = HTMLPurifier_Config::createDefault(); > $conf->set('Cache.SerializerPath', $d); > - if ($prefs['feature_wysiwyg'] == 'y' || $prefs['popupLinks'] == 'y') { > - $conf->set('HTML.DefinitionID', 'allow target'); > - $conf->set('HTML.DefinitionRev', 1); > - $def = $conf->getHTMLDefinition(true); > - $def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top'); > - } > + if ($prefs['feature_wysiwyg'] == 'y' || $prefs['popupLinks'] == 'y') { > + $conf->set('HTML.DefinitionID', 'allow target'); > + $conf->set('HTML.DefinitionRev', 1); > + $conf->set('HTML.Doctype', 'XHTML 1.0 Transitional'); > + $conf->set('HTML.TidyLevel', 'light'); > + $def = $conf->getHTMLDefinition(true); > + $def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top'); > + // Add usemap attribute to img tag > + $def->addAttribute('img', 'usemap', 'CDATA'); > + > + // Add map tag > + $map = $def->addElement( > + 'map', // name > + 'Block', // content set > + 'Flow', // allowed children > + 'Common', // attribute collection > + array( // attributes > + 'name' => 'CDATA', > + 'id' => 'ID', > + 'title' => 'CDATA', > + ) > + ); > + $map->excludes = array('map' => true); > + > + // Add area tag > + $area = $def->addElement( > + 'area', // name > + 'Block', // content set > + 'Empty', // don't allow children > + 'Common', // attribute collection > + array( // attributes > + 'name' => 'CDATA', > + 'id' => 'ID', > + 'alt' => 'Text', > + 'coords' => 'CDATA', > + 'accesskey' => 'Character', > + 'nohref' => new HTMLPurifier_AttrDef_Enum(array('nohref')), > + 'href' => 'URI', > + 'shape' => new HTMLPurifier_AttrDef_Enum(array('rect','circle','poly','default')), > + 'tabindex' => 'Number', > + 'target' => new HTMLPurifier_AttrDef_Enum(array('_blank','_self','_target','_top')) > + ) > + ); > + $area->excludes = array('area' => true); > + } > return $conf; > } > > > > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. > > ------------------------------------------------------------------------------ > Free Software Download: Index, Search & Analyze Logs and other IT data in > Real-Time with Splunk. Collect, index and harness all the fast moving IT data > generated by your applications, servers and devices whether physical, virtual > or in the cloud. Deliver compliance at lower cost and gain new business > insights. http://p.sf.net/sfu/splunk-dev2dev > _______________________________________________ > Tikiwiki-cvs mailing list > Tik...@li... > https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs > > ---------------------------------------- > Freehosting PIPNI - http://www.pipni.cz/ > |