Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
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 |
Parser.php
01 <?php
02
03 /*
04 * @package s9e\TextFormatter
05 * @copyright Copyright (c) 2010-2016 The s9e Authors
06 * @license http://www.opensource.org/licenses/mit-license.php The MIT License
07 */
08 namespace s9e\TextFormatter\Plugins\Censor;
09 use s9e\TextFormatter\Plugins\ParserBase;
10 class Parser extends ParserBase
11 {
12 public function parse($text, array $matches)
13 {
14 $tagName = $this->config['tagName'];
15 $attrName = $this->config['attrName'];
16 $replacements = (isset($this->config['replacements'])) ? $this->config['replacements'] : array();
17 foreach ($matches as $m)
18 {
19 if ($this->isAllowed($m[0][0]))
20 continue;
21 $tag = $this->parser->addSelfClosingTag($tagName, $m[0][1], \strlen($m[0][0]));
22 foreach ($replacements as $_681051f1)
23 {
24 list($regexp, $replacement) = $_681051f1;
25 if (\preg_match($regexp, $m[0][0]))
26 {
27 $tag->setAttribute($attrName, $replacement);
28 break;
29 }
30 }
31 }
32 }
33 protected function isAllowed($word)
34 {
35 return (isset($this->config['allowed']) && \preg_match($this->config['allowed'], $word));
36 }
37 }