Advertisement:

Author Topic: Strange behavior of img/float tag parameters in post modify function  (Read 226 times)

Offline Toebiash

  • Newbie
  • *
  • Posts: 3
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:

Code: [Select]
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:
Code: [Select]
[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:
Code: [Select]
[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:
Code: [Select]
[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:
Code: [Select]
[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

Offline SychO

  • Lead Customizer
  • SMF Hero
  • *
  • Posts: 1,526
  • Gender: Male
    • SychO9 on GitHub
    • SychO
Re: Strange behavior of img/float tag parameters in post modify function
« Reply #1 on: March 08, 2019, 02:00:29 PM »
it's a bug, I just created an issue for it on github
https://github.com/SimpleMachines/SMF2.1/issues/5494

thanks for the report.

Imazighen