Foren / Cotonti / Support / htmlpurifier stripping relationship attribute from hyperlinks [FIXED]

Hodges
#1 29. März 2013, 17:25

Hi there,

In order to make fancyBox operate in "gallery-mode" the rel attribute needs to be set to "gallery1". Unfortunately, although CKEditor can insert the required html into the editing source, once the page is submitted, the rel attribute is stripped. I can brute-force it in phpMyAdmin to make it work, but that is an ugly workaround.

Any ideas?

Cheers,
Hodges

Example: link1

Code:

<a href="#" rel="gallery1">link1</a>

 


Dieser Beitrag wurde von Hodges (am 29. März 2013, 21:36, vor 11 Jahre) bearbeitet
Trustmaster
#2 29. März 2013, 18:24

It might actually be HTML Purifier plugin, not CKEditor.

May the Source be with you!
Hodges
#3 29. März 2013, 21:35

You are, as ever, correct! The solution is to add the following line to plugins / htmlpurifier / presets / htmlpurifier.group_5.preset.php:

 

$config->set('Attr.AllowedRel', 'gallery1,gallery2,gallery3,gallery4');

 

I've chosen group 5 so only admins have this privilege and only the allowed values: gallery1,2,3,4 so only up to 4 galleries per page are allowed.

Thanks for steering me in the right direction!


Dieser Beitrag wurde von Hodges (am 2. April 2013, 20:06, vor 11 Jahre) bearbeitet