Skip to content
Discussion options

You must be logged in to vote

Another attempt would be to keep the yellow core untouched and use a little extension.

I fiddeled around a bit and came to a rather nice solution, I think:

<?php
// get the global yellow core
global $yellow;
// set default protocols
$yellow->system->setDefault("coreSafeUrlProtocols", "http,https,ftp,mailto,tel");
// override yellow lookup
$yellow->lookup = new YellowLookupExtended($yellow);

class YellowLookupExtended extends YellowLookup
{
    public function isSafeUrl($url)
    {
        $protocols = implode('|', preg_split("/\s*,\s*/", $this->yellow->system->get("coreSafeUrlProtocols")));
        return preg_match("/^(" . $protocols . "):/", $url);
    }
}

It's like a normal yellow ext…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by upputter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant