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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

DisallowElementNS.php

Zuletzt modifiziert: 02.04.2025, 15:04 - Dateigröße: 1.39 KiB


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 DisallowElementNS extends TemplateCheck
16  {
17      /**
18      * @var string Local name of the disallowed element
19      */
20      public $elName;
21   
22      /**
23      * @var string Namespace URI of the disallowed element
24      */
25      public $namespaceURI;
26   
27      /**
28      * Constructor
29      *
30      * @param  string $namespaceURI Namespace URI of the disallowed element
31      * @param  string $elName       Local name of the disallowed element
32      */
33      public function __construct($namespaceURI, $elName)
34      {
35          $this->namespaceURI  = $namespaceURI;
36          $this->elName        = $elName;
37      }
38   
39      /**
40      * Test for the presence of an element of given name in given namespace
41      *
42      * @param  DOMElement $template <xsl:template/> node
43      * @param  Tag        $tag      Tag this template belongs to
44      * @return void
45      */
46      public function check(DOMElement $template, Tag $tag)
47      {
48          $node = $template->getElementsByTagNameNS($this->namespaceURI, $this->elName)->item(0);
49   
50          if ($node)
51          {
52              throw new UnsafeTemplateException("Element '" . $node->nodeName . "' is disallowed", $node);
53          }
54      }
55  }