Last active
August 29, 2015 14:21
-
-
Save RaymondBenc/65d072b7de56ef3b2c4c to your computer and use it in GitHub Desktop.
YouTube Device Support fix for PHPfox v3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# file: /module/video/include/service/grab.class.php | |
# Look for: | |
if (strpos($sUrl, 'youtube') || (preg_match('/http:\/\/youtu\.be\/(.*)/i', $sUrl, $aMatches) && isset($aMatches[1]))) | |
{ | |
$this->_aRegex = false; | |
$this->_aSites = $this->_aSiteCache; | |
if (isset($aMatches) && $aMatches[1]) | |
{ | |
$sUrl = 'http://www.youtube.com/watch?v=' . $aMatches[1]; | |
} | |
} | |
# Replace with: | |
if (strpos($sUrl, 'youtube') || (preg_match('/(http|https):\/\/youtu\.be\/(.*)/i', $sUrl, $aMatches) && isset($aMatches[2]))) | |
{ | |
// $this->_aRegex = false; | |
$this->_aSites = $this->_aSiteCache; | |
if (isset($aMatches) && $aMatches[2]) | |
{ | |
$sUrl = 'http://www.youtube.com/watch?v=' . $aMatches[2]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment