public function processLink($url, $tagName = '')
    {
        $label = $url = trim($url);
        $targetBlank = $this->getParam('targetBlank');
        $nofollow = $this->getParam('nofollow');
        // shortening of long URLs
        if ($this->getParam('shortenLongUrl') && strlen($label) > 40)
            $label = substr($label, 0, 40) . '...';
        // Javascript XSS check
        if (substr($url, 0, strlen('javascript:')) === 'javascript:')
            $url = '#';
        else {
            // email check
            if (filter_var($url, FILTER_VALIDATE_EMAIL)) {
                $url = "mailto:$url";
                $targetBlank = $nofollow = false;
            } else if (substr($url, 0, strlen('mailto:')) === 'mailto:') {
                $label = substr($url, strlen('mailto:'));
                $targetBlank = $nofollow = false;
            }
            // if a specific URL process function was defined, it is called
            /** @var callable $func */
            $func = $this->getParam('urlProcessFunction');
            if (isset($func))
                list($url, $label, $targetBlank, $nofollow) = $func($url, $label, $targetBlank, $nofollow);
        }

        return (array($url, $label, $targetBlank, $nofollow));
    }
public function processLink($url, $tagName = '')
    {
        $label = $url = trim($url);
        $targetBlank = $this->getParam('targetBlank');
        $nofollow = $this->getParam('nofollow');
        // shortening of long URLs
        if ($this->getParam('shortenLongUrl') && strlen($label) > 40)
            $label = substr($label, 0, 40) . '...';
        // Javascript XSS check
        if (substr($url, 0, strlen('javascript:')) === 'javascript:')
            $url = '#';
        else {
            // email check
            if (filter_var($url, FILTER_VALIDATE_EMAIL)) {
                $url = "mailto:$url";
                $targetBlank = $nofollow = false;
            } else if (substr($url, 0, strlen('mailto:')) === 'mailto:') {
                $label = substr($url, strlen('mailto:'));
                $targetBlank = $nofollow = false;
            }
            // if a specific URL process function was defined, it is called
            /** @var callable $func */
            $func = $this->getParam('urlProcessFunction');
            if (isset($func))
                list($url, $label, $targetBlank, $nofollow) = $func($url, $label, $targetBlank, $nofollow);
        }

        return (array($url, $label, $targetBlank, $nofollow));
    }
public function processLink ( $ url , $ tagName = '' ) { $ label = $ url = trim ( $ url ) ; $ targetBlank = $ this -> getParam ( 'targetBlank' ) ; $ nofollow = $ this -> getParam ( 'nofollow' ) ; // shortening of long URLs if ( $ this -> getParam ( 'shortenLongUrl' ) && strlen ( $ label ) > 40 ) $ label = substr ( $ label , 0 , 40 ) . '...' ; // Javascript XSS check if ( substr ( $ url , 0 , strlen ( 'javascript:' ) ) === 'javascript:' ) $ url = '#' ; else { // email check if ( filter_var ( $ url , FILTER_VALIDATE_EMAIL ) ) { $ url = "mailto:$url" ; $ targetBlank = $ nofollow = false ; } else if ( substr ( $ url , 0 , strlen ( 'mailto:' ) ) === 'mailto:' ) { $ label = substr ( $ url , strlen ( 'mailto:' ) ) ; $ targetBlank = $ nofollow = false ; } // if a specific URL process function was defined, it is called /** @var callable $func */ $ func = $ this -> getParam ( 'urlProcessFunction' ) ; if ( isset ( $ func ) ) list ( $ url , $ label , $ targetBlank , $ nofollow ) = $ func ( $ url , $ label , $ targetBlank , $ nofollow ) ; } return ( array ( $ url , $ label , $ targetBlank , $ nofollow ) ) ; }
Links processing.
@param    string $url The URL to process.
@param    string $tagName Name of the calling tag.
@return    array    Array with the processed URL and the generated label.
Third parameter is about blank targeting of the link. It could be
null (use the default behaviour), true (add a blank targeting) or
false (no blank targeting).
Links processing .