Topic: Can't validate the following bbcode

Can someone please tell me why this would not validate:

<a id="furl" class="tool_btn" title=<?php echo '"'.$lang_modern_bbcode['FURL title'].'"' ?> href="javascript:insert_text('[url=http://fill in the blank]','Page Title[/url]')"><?php echo $lang_modern_bbcode['FURL'] ?></a>

I get the following:

line 248 column 8 - Warning: <a> escaping malformed URI reference

This is what I have in my parser.php file:

    // Do the more complex BBCodes (also strip excessive whitespace and useless quotes)
    $a = array( '#\[url=("|\'|)(.*?)\\1\]\s*#i',
                '#\[url\]\s*#i',
                '#\s*\[/url\]#i',
                '#\[email=("|\'|)(.*?)\\1\]\s*#i',
                '#\[email\]\s*#i',
                '#\s*\[/email\]#i',
                '#\[img\]\s*(.*?)\s*\[/img\]#is',
                '#\[colou?r=("|\'|)(.*?)\\1\](.*?)\[/colou?r\]#is');

    $b = array(    '[url=$2]',
                '[url]',
                '[/url]',
                '[email=$2]',
                '[email]',
                '[/email]',
                '[img]$1[/img]',
                '[color=$2]$3[/color]');

Thanks
Shedrock

FluxBB Site - Shedrock Online

Re: Can't validate the following bbcode

It's a warning, not an error. I think the point of it is that your URI (the value within the href) is not properly encoded.

Re: Can't validate the following bbcode

try this, set the href to # and use this onclick

onclick="insert_text('[url=http://fill in the blank]','Page Title[/url]'); return false"

Re: Can't validate the following bbcode

Looks like the attribute title lacks the first quotes though.

Re: Can't validate the following bbcode

the quotes are in the echo

Re: Can't validate the following bbcode

Can you paste the actual HTML output rather than the PHP code?

Re: Can't validate the following bbcode

Gizzmo wrote:

try this, set the href to # and use this onclick

onclick="insert_text('[url=http://fill in the blank]','Page Title[/url]'); return false"

Thanks Gizzmo,

This worked great.

Shedrock

FluxBB Site - Shedrock Online