public function parse(array $tag, $content) {

        // If more than 1 http:// is found in the string, possible XSS attack
        if ((mb_substr_count($content, 'http://') + mb_substr_count($content, 'https://')) > 1) {
            return null;
        }

        $tag['attributes']['src'] = $content;

        if (!empty($tag['attributes']['default'])) {
            list($width, $height) = explode('x', $tag['attributes']['default']);

            $tag['attributes']['width'] = $width;
            $tag['attributes']['height'] = $height;
        }

        if (empty($tag['attributes']['alt'])) {
            $tag['attributes']['alt'] = '';
        }

        return parent::parse($tag, $content);
    }
public function parse(array $tag, $content) {

        // If more than 1 http:// is found in the string, possible XSS attack
        if ((mb_substr_count($content, 'http://') + mb_substr_count($content, 'https://')) > 1) {
            return null;
        }

        $tag['attributes']['src'] = $content;

        if (!empty($tag['attributes']['default'])) {
            list($width, $height) = explode('x', $tag['attributes']['default']);

            $tag['attributes']['width'] = $width;
            $tag['attributes']['height'] = $height;
        }

        if (empty($tag['attributes']['alt'])) {
            $tag['attributes']['alt'] = '';
        }

        return parent::parse($tag, $content);
    }
public function parse ( array $ tag , $ content ) { // If more than 1 http:// is found in the string, possible XSS attack if ( ( mb_substr_count ( $ content , 'http://' ) + mb_substr_count ( $ content , 'https://' ) ) > 1 ) { return null ; } $ tag [ 'attributes' ] [ 'src' ] = $ content ; if ( ! empty ( $ tag [ 'attributes' ] [ 'default' ] ) ) { list ( $ width , $ height ) = explode ( 'x' , $ tag [ 'attributes' ] [ 'default' ] ) ; $ tag [ 'attributes' ] [ 'width' ] = $ width ; $ tag [ 'attributes' ] [ 'height' ] = $ height ; } if ( empty ( $ tag [ 'attributes' ] [ 'alt' ] ) ) { $ tag [ 'attributes' ] [ 'alt' ] = '' ; } return parent :: parse ( $ tag , $ content ) ; }
Use the content as the image source.

@param array $tag
@param string $content
@return string
Use the content as the image source .