public function isSocialUrl($url, $socialName = false)
    {
        foreach ($this->getDefinitions() as $domain => $name) {

            if (preg_match('/(^|[\.\/])'.$domain.'([\.\/]|$)/', $url) && ($socialName === false || $name == $socialName)) {

                return true;
            }
        }

        return false;
    }
public function isSocialUrl($url, $socialName = false)
    {
        foreach ($this->getDefinitions() as $domain => $name) {

            if (preg_match('/(^|[\.\/])'.$domain.'([\.\/]|$)/', $url) && ($socialName === false || $name == $socialName)) {

                return true;
            }
        }

        return false;
    }
public function isSocialUrl ( $ url , $ socialName = false ) { foreach ( $ this -> getDefinitions ( ) as $ domain => $ name ) { if ( preg_match ( '/(^|[\.\/])' . $ domain . '([\.\/]|$)/' , $ url ) && ( $ socialName === false || $ name == $ socialName ) ) { return true ; } } return false ; }
Returns true if a URL belongs to a social network, false if otherwise.

@param string $url The URL to check.
@param string|bool $socialName The social network's name to check for, or false to check
for any.
@return bool
Returns true if a URL belongs to a social network false if otherwise .