Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
DisallowUnsafeCopyOf.php
01 <?php
02
03 /**
04 * @package s9e\TextFormatter
05 * @copyright Copyright (c) 2010-2022 The s9e authors
06 * @license http://www.opensource.org/licenses/mit-license.php The MIT License
07 */
08 namespace s9e\TextFormatter\Configurator\TemplateChecks;
09
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 DisallowUnsafeCopyOf extends TemplateCheck
16 {
17 /**
18 * Check for unsafe <xsl:copy-of/> elements
19 *
20 * Any select expression that is not a set of named attributes is considered unsafe
21 *
22 * @param DOMElement $template <xsl:template/> node
23 * @param Tag $tag Tag this template belongs to
24 * @return void
25 */
26 public function check(DOMElement $template, Tag $tag)
27 {
28 $nodes = $template->getElementsByTagNameNS(self::XMLNS_XSL, 'copy-of');
29 foreach ($nodes as $node)
30 {
31 $expr = $node->getAttribute('select');
32
33 if (!preg_match('#^@[-\\w]*(?:\\s*\\|\\s*@[-\\w]*)*$#D', $expr))
34 {
35 throw new UnsafeTemplateException("Cannot assess the safety of '" . $node->nodeName . "' select expression '" . $expr . "'", $node);
36 }
37 }
38 }
39 }