Fork me on GitHub
Subscribe 4

Ticket #152 (fixed bug)

Error quoting a post with an image used as URL

  • Created: 2010-10-01 20:35:32
  • Reported by: Gil
  • Assigned to: Reines
  • Milestone: 1.4.3
  • Component: code
  • Priority: normal

When trying to quote a post whith an image used as URL


, the validation is refused.

The content is replaced by :


which is forbidden (url in url). It was OK in 1.2

For an example, refer to


Gil 2010-10-01 20:37:06

  • Description changed. (Diff)

Gil 2010-10-01 20:37:33

  • Description changed. (Diff)

Gil 2010-10-01 21:03:57

I just tested with 1.2 version: syntax was exactly the same, but URL in URL was simply accepted (either inside or outside the quote). The 'usability result' was a like a link to the thumbnail (as the external URL was absent).

To explain, the 1.2 xhtml result was:
<a href="http://image"></a><a href="http://thumbnail">http://thumbnail</a>

taylorchu 2010-10-01 22:38:14

it is a parser bug that both exists in FluxBB 1.2 and 1.4.

Gil 2010-10-01 23:14:49

OK, but in 1.2, the BBCode quote/url/url syntax was accepted; not in 1.4. The resulting xhtlm code indeed was not perfect, but at least there is no quote validation error.

taylorchu 2010-10-02 06:28:32

For 1.4, there is a method to check which bbcode can be there inside the other bbcode.

    $tags_limit_bbcode = array(
        '*'     => array('b', 'i', 'u', 's', 'ins', 'del', 'em', 'color', 'colour', 'url', 'email', 'list', 'img', 'code'),
        'list'     => array('*'),
        'url'     => array('b', 'i', 'u', 's', 'ins', 'del', 'em', 'color', 'colour', 'img'),
        'email' => array('b', 'i', 'u', 's', 'ins', 'del', 'em', 'color', 'colour', 'img'),
        'img'     => array(),
        'h'        => array('b', 'i', 'u', 's', 'ins', 'del', 'em', 'color', 'colour', 'url', 'email'),

should generate

<a href="http://image"><img src="http://thumbnail"></a>

Reines 2010-10-04 21:55:20

  • Milestone set to 1.4.3.

Reines 2010-10-16 14:49:11

How should we go about fixing this? Really we have a couple options:

  • Don't change images to urls when quoting.

  • Simply remove the image tags when quoting, then do_clickable should make them into urls if needed (I think).

  • Try to do some fancy regex to only make them into urls if it wont cause a problem.

taylorchu 2010-10-17 03:50:23

do_clickable is annoying when I try to add image but image eventually is quoted by \[img\] \[url\].

IMHO, I dont think we need do_clickable. Users know whether they are going to use url or not.

Reines 2010-10-18 08:56:13

  • Owner set to Reines.
  • Status changed from open to fixed.

Should be sorted.

Reines 2010-10-18 08:56:20

Commit 0d0daf5 to fluxbb fluxbb-1.4

Instead of turning img tags into url tags, simply remove them. This avoids generating nested url tags, which are invalid. #152.

x3dt 2010-10-20 07:32:54

i try but that not completely work

if you have multiple


the first one keep


the second keep the


after that is ok only the two first have problem

Reines 2010-10-20 08:39:17

  • Status changed from fixed to open.

Reines 2010-10-20 14:49:44

x3dt could you post an example here in the test board please? I'm not having the same issue.

Reines 2010-10-20 16:54:07

  • Status changed from open to fixed.

Cheers, should be sorted now I think. Please shout if you find any other issues.