-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
accept any value for the rel attribute
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* @link https://craftcms.com/ | ||
* @copyright Copyright (c) Pixel & Tonic, Inc. | ||
* @license https://craftcms.github.io/license/ | ||
*/ | ||
|
||
namespace craft\htmlpurifier; | ||
|
||
use HTMLPurifier_AttrDef_HTML_LinkTypes; | ||
|
||
/** | ||
* Class VideoEmbedUrlDef | ||
* | ||
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com> | ||
* @since 5.6.11 | ||
*/ | ||
class RelAttrLinkTypeDef extends HTMLPurifier_AttrDef_HTML_LinkTypes | ||
{ | ||
public function validate($string, $config, $context) | ||
{ | ||
// allow any value in the "rel" attribute | ||
$allowed = $config->get('Attr.' . $this->name); | ||
if (isset($allowed['*']) && $allowed['*']) { | ||
return $string; | ||
} | ||
|
||
return parent::validate($string, $config, $context); | ||
} | ||
} |