Merge branch 'bugfix/html-links-in-plugin-output-don-t-behave-as-expected-11267'

fixes #11267
This commit is contained in:
Eric Lippmann 2016-06-03 15:33:16 +02:00
commit 1de446fa3d
2 changed files with 4 additions and 7 deletions

View File

@ -174,7 +174,8 @@ class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract
$config = HTMLPurifier_Config::createDefault(); $config = HTMLPurifier_Config::createDefault();
$config->set('Core.EscapeNonASCIICharacters', true); $config->set('Core.EscapeNonASCIICharacters', true);
$config->set('HTML.Allowed', 'p,br,b,a[href],i,table,tr,td[colspan],div,*[class]'); $config->set('HTML.Allowed', 'p,br,b,a[href|target],i,table,tr,td[colspan],div,*[class]');
$config->set('Attr.AllowedFrameTargets', array('_blank'));
// This avoids permission problems: // This avoids permission problems:
// $config->set('Core.DefinitionCache', null); // $config->set('Core.DefinitionCache', null);
$config->set('Cache.DefinitionImpl', null); $config->set('Cache.DefinitionImpl', null);

View File

@ -420,8 +420,8 @@
var linkTarget = $a.attr('target'); var linkTarget = $a.attr('target');
var $target; var $target;
var formerUrl; var formerUrl;
var remote = /^(?:[a-z]+:)\/\//; if (href.match(/^(?:(?:mailto|javascript|data):|[a-z]+:\/\/)/)) {
if (href.match(/^(mailto|javascript|data):/)) { event.stopPropagation();
return true; return true;
} }
@ -439,10 +439,6 @@
} }
} }
// Let remote links pass through
if (href.match(remote)) {
return true;
}
// window.open is used as return true; didn't work reliable // window.open is used as return true; didn't work reliable
if (linkTarget === '_blank' || linkTarget === '_self') { if (linkTarget === '_blank' || linkTarget === '_self') {
window.open(href, linkTarget); window.open(href, linkTarget);