[ Index ] |
PHP Cross Reference of phpBB-3.3.14-deutsch |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package s9e\TextFormatter 5 * @copyright Copyright (c) 2010-2022 The s9e authors 6 * @license http://www.opensource.org/licenses/mit-license.php The MIT License 7 */ 8 namespace s9e\TextFormatter\Configurator\TemplateChecks; 9 10 use DOMElement; 11 use s9e\TextFormatter\Configurator\Exceptions\UnsafeTemplateException; 12 use s9e\TextFormatter\Configurator\Items\Tag; 13 use s9e\TextFormatter\Configurator\TemplateCheck; 14 15 class DisallowDynamicAttributeNames extends TemplateCheck 16 { 17 /** 18 * Test for the presence of an <xsl:attribute/> node using a dynamic name 19 * 20 * @param DOMElement $template <xsl:template/> node 21 * @param Tag $tag Tag this template belongs to 22 * @return void 23 */ 24 public function check(DOMElement $template, Tag $tag) 25 { 26 $nodes = $template->getElementsByTagNameNS(self::XMLNS_XSL, 'attribute'); 27 foreach ($nodes as $node) 28 { 29 if (strpos($node->getAttribute('name'), '{') !== false) 30 { 31 throw new UnsafeTemplateException('Dynamic <xsl:attribute/> names are disallowed', $node); 32 } 33 } 34 } 35 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Mon Nov 25 19:05:08 2024 | Cross-referenced by PHPXref 0.7.1 |