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

DisallowObjectParamsWithGeneratedName.php

Zuletzt modifiziert: 02.04.2025, 15:04 - Dateigröße: 1.38 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 DOMXPath;
12  use s9e\TextFormatter\Configurator\Exceptions\UnsafeTemplateException;
13  use s9e\TextFormatter\Configurator\Items\Tag;
14  use s9e\TextFormatter\Configurator\TemplateCheck;
15   
16  class DisallowObjectParamsWithGeneratedName extends TemplateCheck
17  {
18      /**
19      * Check for <param> elements with a generated "name" attribute
20      *
21      * This check will reject <param> elements whose "name" attribute is generated by an
22      * <xsl:attribute/> element. This is a setup that has no practical use and should be eliminated
23      * because it makes it much harder to check the param's name, and therefore infer the type of
24      * content it expects
25      *
26      * @param  DOMElement $template <xsl:template/> node
27      * @param  Tag        $tag      Tag this template belongs to
28      * @return void
29      */
30      public function check(DOMElement $template, Tag $tag)
31      {
32          $xpath = new DOMXPath($template->ownerDocument);
33          $query = '//object//param[contains(@name, "{") or .//xsl:attribute[translate(@name, "NAME", "name") = "name"]]';
34          $nodes = $xpath->query($query);
35   
36          foreach ($nodes as $node)
37          {
38              throw new UnsafeTemplateException("A 'param' element with a suspect name has been found", $node);
39          }
40      }
41  }