[ Index ]

PHP Cross Reference of phpBB-3.2.8-deutsch

title

Body

[close]

/vendor/s9e/text-formatter/src/Plugins/Emoji/ -> Parser.php (source)

   1  <?php
   2  
   3  /*
   4  * @package   s9e\TextFormatter
   5  * @copyright Copyright (c) 2010-2019 The s9e Authors
   6  * @license   http://www.opensource.org/licenses/mit-license.php The MIT License
   7  */
   8  namespace s9e\TextFormatter\Plugins\Emoji;
   9  use s9e\TextFormatter\Plugins\ParserBase;
  10  class Parser extends ParserBase
  11  {
  12      protected $shortnameRegexp = '/:[-+_a-z0-9]+(?=:)/';
  13      protected $unicodeRegexp = '((?:[#*0-9]\\xEF\\xB8\\x8F(?:\\xE2\\x83\\xA3)?|\\xC2[\\xA9\\xAE]\\xEF\\xB8\\x8F|\\xE2(?:\\x80\\xBC\\xEF\\xB8\\x8F|\\x81\\x89\\xEF\\xB8\\x8F|\\x84[\\xA2\\xB9]\\xEF\\xB8\\x8F|\\x86[\\x94-\\x99\\xA9\\xAA]\\xEF\\xB8\\x8F|\\x8C(?:[\\x9A\\x9B]|\\xA8\\xEF\\xB8\\x8F)|\\x8F(?:[\\x8F\\xAD-\\xAF\\xB1\\xB2\\xB8-\\xBA]\\xEF\\xB8\\x8F|[\\xA9-\\xAC\\xB0\\xB3])|\\x93\\x82\\xEF\\xB8\\x8F|\\x96[\\xAA\\xAB\\xB6]\\xEF\\xB8\\x8F|\\x97(?:[\\x80\\xBB\\xBC]\\xEF\\xB8\\x8F|[\\xBD\\xBE])|\\x98(?:[\\x80-\\x84\\x8E\\x91\\x98\\xA0\\xA2\\xA3\\xA6\\xAA\\xAE\\xAF\\xB8-\\xBA]\\xEF\\xB8\\x8F|[\\x94\\x95]|\\x9D(?:\\xEF\\xB8\\x8F|\\xF0\\x9F\\x8F[\\xBB-\\xBF]))|\\x99(?:[\\x80\\x82\\x9F\\xA0\\xA3\\xA5\\xA6\\xA8\\xBB\\xBE]\\xEF\\xB8\\x8F|[\\x88-\\x93\\xBF])|\\x9A(?:[\\x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\\x9D\\xE2\\x80\\x8D\\xF0\\x9F\\xA7\\x91\\xF0\\x9F\\x8F[\\xBB-\\xBD])?|\\xBE(?:\\xE2\\x80\\x8D\\xF0\\x9F\\xA4\\x9D\\xE2\\x80\\x8D\\xF0\\x9F\\xA7\\x91\\xF0\\x9F\\x8F[\\xBB-\\xBE])?|\\xBF(?:\\xE2\\x80\\x8D\\xF0\\x9F\\xA4\\x9D\\xE2\\x80\\x8D\\xF0\\x9F\\xA7\\x91\\xF0\\x9F\\x8F[\\xBB-\\xBF])?))?)|\\xA9[\\xB0-\\xB3\\xB8-\\xBA]|\\xAA[\\x80-\\x82\\x90-\\x95]))(?!\\xEF\\xB8\\x8E)(?:\\xEF\\xB8\\x8F)?)S';
  14  	public function parse($text, array $matches)
  15      {
  16          $this->parseShortnames($text);
  17          $this->parseCustomAliases($text);
  18          $this->parseUnicode($text);
  19      }
  20  	protected function addTag($tagPos, $tagLen, $hex)
  21      {
  22          $tag = $this->parser->addSelfClosingTag($this->config['tagName'], $tagPos, $tagLen, 10);
  23          $seq = \str_replace(['-200d', '-fe0f'], '', $hex);
  24          $tag->setAttribute($this->config['attrName'], $seq);
  25          $tseq = \ltrim($hex, '0');
  26          if (\strpos($tseq, '-200d') === \false)
  27              $tseq = \str_replace('-fe0f', '', $tseq);
  28          $tag->setAttribute('tseq', $tseq);
  29      }
  30  	protected function getHexSequence($str)
  31      {
  32          $seq = [];
  33          $i   = 0;
  34          do
  35          {
  36              $cp = \ord($str[$i]);
  37              if ($cp >= 0xF0)
  38                  $cp = ($cp << 18) + (\ord($str[++$i]) << 12) + (\ord($str[++$i]) << 6) + \ord($str[++$i]) - 0x3C82080;
  39              elseif ($cp >= 0xE0)
  40                  $cp = ($cp << 12) + (\ord($str[++$i]) << 6) + \ord($str[++$i]) - 0xE2080;
  41              elseif ($cp >= 0xC0)
  42                  $cp = ($cp << 6) + \ord($str[++$i]) - 0x3080;
  43              $seq[] = \sprintf('%04x', $cp);
  44          }
  45          while (++$i < \strlen($str));
  46          return \implode('-', $seq);
  47      }
  48  	protected function parseCustomAliases($text)
  49      {
  50          if (empty($this->config['customRegexp']))
  51              return;
  52          $matchPos = 0;
  53          if (isset($this->config['customQuickMatch']))
  54          {
  55              $matchPos = \strpos($text, $this->config['customQuickMatch']);
  56              if ($matchPos === \false)
  57                  return;
  58          }
  59          \preg_match_all($this->config['customRegexp'], $text, $matches, \PREG_OFFSET_CAPTURE, $matchPos);
  60          foreach ($matches[0] as $_8bb89e38)
  61          {
  62              list($alias, $tagPos) = $_8bb89e38;
  63              if (isset($this->parser->registeredVars['Emoji.aliases'][$alias]))
  64              {
  65                  $hex = $this->getHexSequence($this->parser->registeredVars['Emoji.aliases'][$alias]);
  66                  $this->addTag($tagPos, \strlen($alias), $hex);
  67              }
  68          }
  69      }
  70  	protected function parseShortnames($text)
  71      {
  72          $matchPos = \strpos($text, ':');
  73          if ($matchPos === \false)
  74              return;
  75          \preg_match_all($this->shortnameRegexp, $text, $matches, \PREG_OFFSET_CAPTURE, $matchPos);
  76          foreach ($matches[0] as $_8bb89e38)
  77          {
  78              list($alias, $tagPos) = $_8bb89e38;
  79              $alias .= ':';
  80              $tagLen = \strlen($alias);
  81              if (isset($this->parser->registeredVars['Emoji.aliases'][$alias]))
  82              {
  83                  $hex = $this->getHexSequence($this->parser->registeredVars['Emoji.aliases'][$alias]);
  84                  $this->addTag($tagPos, $tagLen, $hex);
  85              }
  86              elseif (\preg_match('/^:[0-3][0-9a-f]{3,4}(?:-[0-9a-f]{4,5})*:$/', $alias))
  87                  $this->addTag($tagPos, $tagLen, \substr($alias, 1, -1));
  88          }
  89      }
  90  	protected function parseUnicode($text)
  91      {
  92          if (\strpos($text, "\xE2") === \false && \strpos($text, "\xEF") === \false && \strpos($text, "\xF0") === \false)
  93              return;
  94          \preg_match_all($this->unicodeRegexp, $text, $matches, \PREG_OFFSET_CAPTURE);
  95          foreach ($matches[0] as $_e20330bd)
  96          {
  97              list($emoji, $tagPos) = $_e20330bd;
  98              $this->addTag($tagPos, \strlen($emoji), $this->getHexSequence($emoji));
  99          }
 100      }
 101  }


Generated: Tue Apr 7 19:42:26 2020 Cross-referenced by PHPXref 0.7.1