Skip to content

Commit

Permalink
Updated library
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed May 29, 2017
1 parent 9b440b0 commit 8082dfb
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bundle.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "phpbb-extension",
"description": "Embed third-party content in your phpBB forum",
"homepage": "https://github.com/s9e/phpbb-ext-mediaembed/",
"version": "20170122",
"version": "20170529",
"keywords": ["phpbb","embed","forum","media"],
"license": "MIT",
"require": {
Expand Down
23 changes: 16 additions & 7 deletions parsing.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ protected function finalizeOutput()
$this->outputText($this->textLen, 0, \true);
do
{
$this->output = \preg_replace('(<([^ />]+)[^>]*></\\1>)', '', $this->output, -1, $cnt);
$this->output = \preg_replace('(<([^ />]++)[^>]*></\\1>)', '', $this->output, -1, $cnt);
}
while ($cnt > 0);
if (\strpos($this->output, '</i><i>') !== \false)
Expand Down Expand Up @@ -568,8 +568,9 @@ protected function closeAncestor(Tag $tag)
$ancestorName = $ancestor->getName();
if (isset($tagConfig['rules']['closeAncestor'][$ancestorName]))
{
++$this->currentFixingCost;
$this->tagStack[] = $tag;
$this->addMagicEndTag($ancestor, $tag->getPos());
$this->addMagicEndTag($ancestor, $tag->getPos(), $tag->getSortPriority() - 1);
return \true;
}
}
Expand All @@ -589,8 +590,9 @@ protected function closeParent(Tag $tag)
$parentName = $parent->getName();
if (isset($tagConfig['rules']['closeParent'][$parentName]))
{
++$this->currentFixingCost;
$this->tagStack[] = $tag;
$this->addMagicEndTag($parent, $tag->getPos());
$this->addMagicEndTag($parent, $tag->getPos(), $tag->getSortPriority() - 1);
return \true;
}
}
Expand Down Expand Up @@ -785,8 +787,9 @@ protected function processStartTag(Tag $tag)
$tag->invalidate();
return;
}
if ($this->fosterParent($tag) || $this->closeParent($tag) || $this->closeAncestor($tag))
return;
if ($this->currentFixingCost < $this->maxFixingCost)
if ($this->fosterParent($tag) || $this->closeParent($tag) || $this->closeAncestor($tag))
return;
if ($this->cntOpen[$tagName] >= $tagConfig['nestingLimit'])
{
$this->logger->err(
Expand Down Expand Up @@ -1234,7 +1237,10 @@ protected static function parseUrl($url)
$parts['scheme'] = \strtolower($parts['scheme']);
$parts['host'] = \rtrim(\preg_replace("/\xE3\x80\x82|\xEF(?:\xBC\x8E|\xBD\xA1)/s", '.', $parts['host']), '.');
if (\preg_match('#[^[:ascii:]]#', $parts['host']) && \function_exists('idn_to_ascii'))
$parts['host'] = \idn_to_ascii($parts['host']);
{
$variant = (\defined('INTL_IDNA_VARIANT_UTS46')) ? \INTL_IDNA_VARIANT_UTS46 : 0;
$parts['host'] = \idn_to_ascii($parts['host'], 0);
}
return $parts;
}
protected static function rebuildUrl(array $p)
Expand Down Expand Up @@ -1604,9 +1610,12 @@ public static function scrape(Tag $tag, array $scrapeConfig, $cacheDir = \null)
if ($tag->hasAttribute('url'))
{
$url = $tag->getAttribute('url');
if (\preg_match('#^https?://[^<>"\'\\s]+$#D', $url))
if (\preg_match('#^https?://[^<>"\'\\s]+$#Di', $url))
{
$url = \strtolower(\substr($url, 0, 5)) . \substr($url, 5);
foreach ($scrapeConfig as $scrape)
self::scrapeEntry($url, $tag, $scrape, $cacheDir);
}
}
return \true;
}
Expand Down
6 changes: 3 additions & 3 deletions rendering.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"stable":{"20170122":{"current":"20170122","announcement":"https:\/\/www.phpbb.com\/community\/viewtopic.php?f=456&t=2272431","download":"https:\/\/github.com\/s9e\/phpbb-ext-mediaembed\/releases\/download\/20170122\/s9e-mediaembed-20170122.zip","eol":null,"security":false}}}
{"stable":{"20170529":{"current":"20170529","announcement":"https:\/\/www.phpbb.com\/community\/viewtopic.php?f=456&t=2272431","download":"https:\/\/github.com\/s9e\/phpbb-ext-mediaembed\/releases\/download\/20170529\/s9e-mediaembed-20170529.zip","eol":null,"security":false}}}

0 comments on commit 8082dfb

Please sign in to comment.