Skip to content

Commit

Permalink
Switched to protocol-relative URLs where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Jan 7, 2014
1 parent 35b4033 commit 3b036d2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions build/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<addon addon_id="s9e" title="s9e Media Pack" url="https://github.com/s9e/XenForoMediaBBCodes" version_id="20140106" version_string="201401060" install_callback_class="s9e_MediaBBCodes" install_callback_method="install">
<addon addon_id="s9e" title="s9e Media Pack" url="https://github.com/s9e/XenForoMediaBBCodes" version_id="20140107" version_string="201401070" install_callback_class="s9e_MediaBBCodes" install_callback_method="install">
<bb_code_media_sites>
<site media_site_id="bandcamp" site_title="Bandcamp" site_url="http://bandcamp.com/" match_is_regex="1" supported="1" embed_html_callback_class="s9e_MediaBBCodes" embed_html_callback_method="embed" match_callback_class="s9e_MediaBBCodes" match_callback_method="matchBandcamp">
<match_urls>!(?'id')bandcamp\.com/album/.!
Expand Down Expand Up @@ -37,7 +37,7 @@
</site>
<site media_site_id="dailymotion" site_title="Dailymotion" site_url="http://www.dailymotion.com/" match_is_regex="1" supported="1">
<match_urls>!dailymotion\.com/(?:video/|user/[^#]+#video=)(?'id'[A-Za-z0-9]+)!</match_urls>
<embed_html><![CDATA[<iframe width="560" height="315" src="http://www.dailymotion.com/embed/video/{$id}" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
<embed_html><![CDATA[<iframe width="560" height="315" src="//www.dailymotion.com/embed/video/{$id}" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
</site>
<site media_site_id="dailyshow" site_title="The Daily Show with Jon Stewart" site_url="http://www.thedailyshow.com/" match_is_regex="1" supported="1" embed_html_callback_class="s9e_MediaBBCodes" embed_html_callback_method="embed" match_callback_class="s9e_MediaBBCodes" match_callback_method="matchDailyshow">
<match_urls>!(?'id')thedailyshow\.com/(?:collection|watch)/!</match_urls>
Expand All @@ -57,7 +57,7 @@
</site>
<site media_site_id="gamespot" site_title="Gamespot" site_url="http://www.gamespot.com/" match_is_regex="1" supported="1">
<match_urls>!gamespot\.com.*?/(?:events|videos)/.*?-(?'id'\d+)/(?:[#?].*)?$!</match_urls>
<embed_html><![CDATA[<iframe width="640" height="400" src="http://www.gamespot.com/videos/embed/{$id}/" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
<embed_html><![CDATA[<iframe width="640" height="400" src="//www.gamespot.com/videos/embed/{$id}/" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
</site>
<site media_site_id="gametrailers" site_title="GameTrailers" site_url="http://www.gametrailers.com/" match_is_regex="1" supported="1" embed_html_callback_class="s9e_MediaBBCodes" embed_html_callback_method="embed" match_callback_class="s9e_MediaBBCodes" match_callback_method="matchGametrailers">
<match_urls>!(?'id')gametrailers\.com/(?:full-episode|review|video)s/!</match_urls>
Expand Down Expand Up @@ -87,7 +87,7 @@
<site media_site_id="indiegogo" site_title="Indiegogo" site_url="http://www.indiegogo.com/" match_is_regex="1" supported="1" match_callback_class="s9e_MediaBBCodes" match_callback_method="matchIndiegogo">
<match_urls>!indiegogo\.com/projects/(?'id'[0-9]+)$!
!(?'id')indiegogo\.com/projects/.!</match_urls>
<embed_html><![CDATA[<iframe width="224" height="486" src="http://www.indiegogo.com/project/{$id}/widget" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
<embed_html><![CDATA[<iframe width="224" height="486" src="//www.indiegogo.com/project/{$id}/widget" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
</site>
<site media_site_id="instagram" site_title="Instagram" site_url="http://instagram.com/" match_is_regex="1" supported="1">
<match_urls>!instagram\.com/p/(?'id'\w+)!</match_urls>
Expand All @@ -108,12 +108,12 @@
<site media_site_id="rutube" site_title="Rutube" site_url="http://rutube.ru/" match_is_regex="1" supported="1" match_callback_class="s9e_MediaBBCodes" match_callback_method="matchRutube">
<match_urls>!rutube\.ru/tracks/(?'id'[0-9]+)!
!(?'id')rutube\.ru/video/[0-9a-f]{32}!</match_urls>
<embed_html><![CDATA[<iframe width="720" height="405" src="http://rutube.ru/video/embed/{$id}" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
<embed_html><![CDATA[<iframe width="720" height="405" src="//rutube.ru/video/embed/{$id}" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
</site>
<site media_site_id="slideshare" site_title="SlideShare" site_url="http://www.slideshare.net/" match_is_regex="1" supported="1" match_callback_class="s9e_MediaBBCodes" match_callback_method="matchSlideshare">
<match_urls>!slideshare\.net/[^/]+/[-\w]+-(?'id'[0-9]{6,})$!
!(?'id')slideshare\.net/[^/]+/\w!</match_urls>
<embed_html><![CDATA[<iframe width="427" height="356" src="http://www.slideshare.net/slideshow/embed_code/{$id}" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
<embed_html><![CDATA[<iframe width="427" height="356" src="//www.slideshare.net/slideshow/embed_code/{$id}" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
</site>
<site media_site_id="soundcloud" site_title="SoundCloud" site_url="https://soundcloud.com/" match_is_regex="1" supported="1" embed_html_callback_class="s9e_MediaBBCodes" embed_html_callback_method="embed" match_callback_class="s9e_MediaBBCodes" match_callback_method="matchSoundcloud">
<match_urls>@(?'id'https?://(?:(?:api\.soundcloud\.com/(?:playlist|track)s/\d+)|soundcloud\.com/[^/]+/(?:sets/)?[^/]+)(?:(?:\?secret_token=|/(?=s-))(?'secret_token'[-\w]+))?)@
Expand All @@ -132,7 +132,7 @@
<site media_site_id="teamcoco" site_title="Team Coco" site_url="http://teamcoco.com/" match_is_regex="1" supported="1" match_callback_class="s9e_MediaBBCodes" match_callback_method="matchTeamcoco">
<match_urls>!teamcoco\.com/video/(?'id'\d+)!
!(?'id')teamcoco\.com/video/.!</match_urls>
<embed_html><![CDATA[<iframe width="640" height="415" src="http://teamcoco.com/embed/v/{$id}" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
<embed_html><![CDATA[<iframe width="640" height="415" src="//teamcoco.com/embed/v/{$id}" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
</site>
<site media_site_id="ted" site_title="TED Talks" site_url="http://www.ted.com/" match_is_regex="1" supported="1">
<match_urls>!ted\.com/(?'id'(?:talk|playlist)s/[^\s"]+)!i</match_urls>
Expand All @@ -154,7 +154,7 @@
</site>
<site media_site_id="vimeo" site_title="Vimeo" site_url="http://vimeo.com/" match_is_regex="1" supported="1">
<match_urls>!vimeo\.com/(?:channels/[^/]+/)?(?'id'[0-9]+)!</match_urls>
<embed_html><![CDATA[<iframe width="560" height="315" src="http://player.vimeo.com/video/{$id}" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
<embed_html><![CDATA[<iframe width="560" height="315" src="//player.vimeo.com/video/{$id}" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
</site>
<site media_site_id="vine" site_title="Vine" site_url="https://vine.co/" match_is_regex="1" supported="1">
<match_urls>!vine\.co/v/(?'id'[^/]+)!</match_urls>
Expand All @@ -163,7 +163,7 @@
<site media_site_id="vk" site_title="VK" site_url="https://vk.com/" match_is_regex="1" supported="1" embed_html_callback_class="s9e_MediaBBCodes" embed_html_callback_method="embed" match_callback_class="s9e_MediaBBCodes" match_callback_method="matchVk">
<match_urls>!(?'id')vk\.com/video(?'oid'-?[0-9]+)_(?'vid'[0-9]+)!
!(?'id')vk\.com/video-?[0-9]+_[0-9]+!</match_urls>
<embed_html><![CDATA[<iframe width="607" height="360" src="http://vk.com/video_ext.php?oid={$oid}&amp;id={$vid}&amp;hash={$hash}&amp;hd=1" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
<embed_html><![CDATA[<iframe width="607" height="360" src="//vk.com/video_ext.php?oid={$oid}&amp;id={$vid}&amp;hash={$hash}&amp;hd=1" allowfullscreen="" frameborder="0" scrolling="no"></iframe>]]></embed_html>
</site>
<site media_site_id="wshh" site_title="WorldStarHipHop" site_url="http://www.worldstarhiphop.com/" match_is_regex="1" supported="1">
<match_urls>!worldstarhiphop\.com/video(?:s/video)?\.php\?v=(?'id'[A-Za-z0-9]+)!</match_urls>
Expand Down
4 changes: 2 additions & 2 deletions build/upload/library/s9e/MediaBBCodes.php
Expand Up @@ -323,7 +323,7 @@ public static function renderGrooveshark($vars)
{
$vars += array('playlistid' => null, 'songid' => null);

$html='<object type="application/x-shockwave-flash" typemustmatch="" width="250" height="'.htmlspecialchars((isset($vars['songid'])?40:250),2).'" data="http://grooveshark.com/'.htmlspecialchars((isset($vars['songid'])?'songW':'w'),2).'idget.swf"><param name="allowfullscreen" value="true"><param name="flashvars" value="playlistID='.htmlspecialchars($vars['playlistid'],2).'&amp;songID='.htmlspecialchars($vars['songid'],2).'"><embed type="application/x-shockwave-flash" src="http://grooveshark.com/'.htmlspecialchars((isset($vars['songid'])?'songW':'w'),2).'idget.swf" width="250" height="'.htmlspecialchars((isset($vars['songid'])?40:250),2).'" allowfullscreen="" flashvars="playlistID='.htmlspecialchars($vars['playlistid'],2).'&amp;songID='.htmlspecialchars($vars['songid'],2).'"></object>';
$html='<object type="application/x-shockwave-flash" typemustmatch="" width="250" height="'.htmlspecialchars((isset($vars['songid'])?40:250),2).'" data="//grooveshark.com/'.htmlspecialchars((isset($vars['songid'])?'songW':'w'),2).'idget.swf"><param name="allowfullscreen" value="true"><param name="flashvars" value="playlistID='.htmlspecialchars($vars['playlistid'],2).'&amp;songID='.htmlspecialchars($vars['songid'],2).'"><embed type="application/x-shockwave-flash" src="//grooveshark.com/'.htmlspecialchars((isset($vars['songid'])?'songW':'w'),2).'idget.swf" width="250" height="'.htmlspecialchars((isset($vars['songid'])?40:250),2).'" allowfullscreen="" flashvars="playlistID='.htmlspecialchars($vars['playlistid'],2).'&amp;songID='.htmlspecialchars($vars['songid'],2).'"></object>';

return $html;
}
Expand Down Expand Up @@ -372,7 +372,7 @@ public static function renderKickstarter($vars)
{
$vars += array('id' => null, 'video' => null);

$html='';if(isset($vars['video']))$html.='<iframe width="480" height="360" src="http://www.kickstarter.com/projects/'.htmlspecialchars($vars['id'],2).'/widget/video.html" allowfullscreen="" frameborder="0" scrolling="no"></iframe>';else$html.='<iframe width="220" height="380" src="http://www.kickstarter.com/projects/'.htmlspecialchars($vars['id'],2).'/widget/card.html" allowfullscreen="" frameborder="0" scrolling="no"></iframe>';
$html='';if(isset($vars['video']))$html.='<iframe width="480" height="360" src="//www.kickstarter.com/projects/'.htmlspecialchars($vars['id'],2).'/widget/video.html" allowfullscreen="" frameborder="0" scrolling="no"></iframe>';else$html.='<iframe width="220" height="380" src="//www.kickstarter.com/projects/'.htmlspecialchars($vars['id'],2).'/widget/card.html" allowfullscreen="" frameborder="0" scrolling="no"></iframe>';

return $html;
}
Expand Down
10 changes: 5 additions & 5 deletions tests/Test.php
Expand Up @@ -310,27 +310,27 @@ public function getEmbedCallbackTests()
array(
'playlistid=74854761',
'<!-- s9e_MediaBBCodes::renderGrooveshark -->',
'<object type="application/x-shockwave-flash" typemustmatch="" width="250" height="250" data="http://grooveshark.com/widget.swf"><param name="allowfullscreen" value="true"><param name="flashvars" value="playlistID=74854761&amp;songID="><embed type="application/x-shockwave-flash" src="http://grooveshark.com/widget.swf" width="250" height="250" allowfullscreen="" flashvars="playlistID=74854761&amp;songID="></object>'
'<object type="application/x-shockwave-flash" typemustmatch="" width="250" height="250" data="//grooveshark.com/widget.swf"><param name="allowfullscreen" value="true"><param name="flashvars" value="playlistID=74854761&amp;songID="><embed type="application/x-shockwave-flash" src="//grooveshark.com/widget.swf" width="250" height="250" allowfullscreen="" flashvars="playlistID=74854761&amp;songID="></object>'
),
array(
'songid=35292216',
'<!-- s9e_MediaBBCodes::renderGrooveshark -->',
'<object type="application/x-shockwave-flash" typemustmatch="" width="250" height="40" data="http://grooveshark.com/songWidget.swf"><param name="allowfullscreen" value="true"><param name="flashvars" value="playlistID=&amp;songID=35292216"><embed type="application/x-shockwave-flash" src="http://grooveshark.com/songWidget.swf" width="250" height="40" allowfullscreen="" flashvars="playlistID=&amp;songID=35292216"></object>'
'<object type="application/x-shockwave-flash" typemustmatch="" width="250" height="40" data="//grooveshark.com/songWidget.swf"><param name="allowfullscreen" value="true"><param name="flashvars" value="playlistID=&amp;songID=35292216"><embed type="application/x-shockwave-flash" src="//grooveshark.com/songWidget.swf" width="250" height="40" allowfullscreen="" flashvars="playlistID=&amp;songID=35292216"></object>'
),
array(
'1869987317/wish-i-was-here-1',
'<!-- s9e_MediaBBCodes::renderKickstarter -->',
'<iframe width="220" height="380" src="http://www.kickstarter.com/projects/1869987317/wish-i-was-here-1/widget/card.html" allowfullscreen="" frameborder="0" scrolling="no"></iframe>'
'<iframe width="220" height="380" src="//www.kickstarter.com/projects/1869987317/wish-i-was-here-1/widget/card.html" allowfullscreen="" frameborder="0" scrolling="no"></iframe>'
),
array(
'card=card;id=1869987317%2Fwish-i-was-here-1',
'<!-- s9e_MediaBBCodes::renderKickstarter -->',
'<iframe width="220" height="380" src="http://www.kickstarter.com/projects/1869987317/wish-i-was-here-1/widget/card.html" allowfullscreen="" frameborder="0" scrolling="no"></iframe>'
'<iframe width="220" height="380" src="//www.kickstarter.com/projects/1869987317/wish-i-was-here-1/widget/card.html" allowfullscreen="" frameborder="0" scrolling="no"></iframe>'
),
array(
'id=1869987317%2Fwish-i-was-here-1;video=video',
'<!-- s9e_MediaBBCodes::renderKickstarter -->',
'<iframe width="480" height="360" src="http://www.kickstarter.com/projects/1869987317/wish-i-was-here-1/widget/video.html" allowfullscreen="" frameborder="0" scrolling="no"></iframe>'
'<iframe width="480" height="360" src="//www.kickstarter.com/projects/1869987317/wish-i-was-here-1/widget/video.html" allowfullscreen="" frameborder="0" scrolling="no"></iframe>'
),
array(
'http://api.soundcloud.com/tracks/98282116',
Expand Down

0 comments on commit 3b036d2

Please sign in to comment.