Verzeichnisstruktur phpBB-3.3.16


Veröffentlicht
27.04.2026

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

DisallowUnsupportedXSL.php

Zuletzt modifiziert: 01.05.2026, 11:28 - Dateigröße: 2.79 KiB


 01  <?php declare(strict_types=1);
 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 RuntimeException;
 12   
 13  class DisallowUnsupportedXSL extends AbstractXSLSupportCheck
 14  {
 15      protected $supportedElements = ['apply-templates', 'attribute', 'choose', 'comment', 'copy-of', 'element', 'for-each', 'if', 'number', 'otherwise', 'processing-instruction', 'sort', 'text', 'value-of', 'variable', 'when'];
 16   
 17      protected $supportedFunctions = ['boolean', 'ceiling', 'concat', 'contains', 'count', 'current', 'document', 'element-available', 'false', 'floor', 'format-number', 'function-available', 'generate-id', 'id', 'key', 'lang', 'last', 'local-name', 'name', 'namespace-uri', 'normalize-space', 'not', 'number', 'position', 'round', 'starts-with', 'string', 'string-length', 'substring', 'substring-after', 'substring-before', 'sum', 'system-property', 'translate', 'true', 'unparsed-entity-uri'];
 18   
 19      protected function checkXslApplyTemplatesElement(DOMElement $applyTemplates): void
 20      {
 21          if ($applyTemplates->hasAttribute('mode'))
 22          {
 23              throw new RuntimeException('xsl:apply-templates elements do not support the mode attribute');
 24          }
 25      }
 26   
 27      protected function checkXslCopyOfElement(DOMElement $copyOf): void
 28      {
 29          $this->requireAttribute($copyOf, 'select');
 30      }
 31   
 32      protected function checkXslAttributeElement(DOMElement $attribute): void
 33      {
 34          $this->requireAttribute($attribute, 'name');
 35   
 36          $attrName = $attribute->getAttribute('name');
 37          if (!preg_match('(^(?:\\{[^\\}]++\\}|[-.\\pL])++$)Du', $attrName))
 38          {
 39              throw new RuntimeException("Unsupported xsl:attribute name '" . $attrName . "'");
 40          }
 41      }
 42   
 43      protected function checkXslElementElement(DOMElement $element): void
 44      {
 45          $this->requireAttribute($element, 'name');
 46   
 47          $elName = $element->getAttribute('name');
 48          if (!preg_match('(^(?:\\{[^\\}]++\\}|[-.\\pL])++(?::(?:\\{[^\\}]++\\}|[-.\\pL])++)?$)Du', $elName))
 49          {
 50              throw new RuntimeException("Unsupported xsl:element name '" . $elName . "'");
 51          }
 52      }
 53   
 54      protected function checkXslIfElement(DOMElement $if): void
 55      {
 56          $this->requireAttribute($if, 'test');
 57      }
 58   
 59      protected function checkXslValueOfElement(DOMElement $valueOf): void
 60      {
 61          $this->requireAttribute($valueOf, 'select');
 62      }
 63   
 64      protected function checkXslVariableElement(DOMElement $variable): void
 65      {
 66          $this->requireAttribute($variable, 'name');
 67      }
 68   
 69      protected function checkXslWhenElement(DOMElement $when): void
 70      {
 71          $this->requireAttribute($when, 'test');
 72      }
 73   
 74      protected function requireAttribute(DOMElement $element, string $attrName)
 75      {
 76          if (!$element->hasAttribute($attrName))
 77          {
 78              throw new RuntimeException('xsl:' . $element->localName . ' elements require a ' . $attrName . ' attribute');
 79          }
 80      }
 81  }