Skip to content

Commit

Permalink
fix conflicts 1
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepereiradasilva committed May 14, 2016
1 parent fea352e commit f22efaf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugins/system/sef/sef.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function onAfterDispatch()

// Check if a canonical html tag already exists (for instance, added by a component).
$canonical = '';

foreach ($doc->_links as $linkUrl => $link)
{
if (isset($link['relation']) && $link['relation'] === 'canonical')
Expand Down Expand Up @@ -98,16 +99,19 @@ public function onAfterRender()
if (strpos($buffer, 'href="index.php?') !== false)
{
preg_match_all('#href="index.php\?([^"]+)"#m', $buffer, $matches);

foreach ($matches[1] as $urlQueryString)
{
$buffer = str_replace('href="index.php?' . $urlQueryString . '"', 'href="' . JRoute::_('index.php?' . $urlQueryString) . '"', $buffer);
}

$this->checkBuffer($buffer);
}

// Check for all unknown protocals (a protocol must contain at least one alpahnumeric character followed by a ":").
$protocols = '[a-zA-Z0-9\-]+:';
$attributes = array('href=', 'src=', 'srcset=', 'poster=');
$protocols = '[a-zA-Z0-9\-]+:';
$attributes = array('href=', 'src=', 'poster=');

foreach ($attributes as $attribute)
{
if (strpos($buffer, $attribute) !== false)
Expand All @@ -128,6 +132,7 @@ public function onAfterRender()

// Replace all unknown protocols in onmouseover and onmouseout attributes.
$attributes = array('onmouseover=', 'onmouseout=');

foreach ($attributes as $attribute)
{
if (strpos($buffer, $attribute) !== false)
Expand Down

0 comments on commit f22efaf

Please sign in to comment.