News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Strange behavior of img/float tag parameters in post modify function

Started by Toebiash, March 08, 2019, 12:03:23 PM

Previous topic - Next topic

Toebiash

Hello,

I have strange behavior of tag parameters in SMF 2.1 RC (last commit 4cc47fb).
I use my own IMG tag parametr (align = left / right) implemented in the subs.php file, example:


array(
'tag' => 'img',
'type' => 'unparsed_content',
'parameters' => array(
'alt' => array('optional' => true),
'title' => array('optional' => true),
'width' => array('optional' => true, 'value' => ' width="$1"', 'match' => '(\d+)'),
'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
// KOCOUR - doplnění parametrů align to tagu img
'align' => array('optional' => true, 'value' => ' align="$1"', 'match' => '(left|right)'),

),
// KOCOUR - nové nastavení s doplněním prostoru při obtékání obrázku
'content' => '<img src="$1" alt="{alt}" title="{title}"{width}{height}{align} border="0" vspace="8" hspace="8" style="padding: 6px;" class="bbc_img resized">',
'validate' => function(&$tag, &$data, $disabled)


example of use in post:
[IMG align=left]http://xxxx.jpg[/IMG]text text text text text...

and everything works fine.
When I used Quick Edit on post with these tag and parameter, everything still works fine.

But when I used normal edit ("Modify"), the whole parameter disappears!  And I get only this:
[IMG]http://xxxx.jpg[/IMG]text text text text text...

First I thought I had a bug in my implementation to subs.php, so I tried use unmodified tag FLOAT just for test:
[FLOAT=left][IMG]http://xxxx.jpg[/IMG][FLOAT]text text text text text... and again, everything works fine, quick edit works fine, but when I used "Modify", I get these:
[float=right max=45%][IMG]http://xxxx.jpg[/IMG][FLOAT]text text text text text...
float changes from left to right plus the parameter with percentages is added! :) ??
so it does not matter what float I use, it always changes to the right with percentages if I use modify

Do am I doing something wrong or it is a bug?

I work in the last Firefox

SychO

Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Advertisement: