Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: Joshua Dickerson on September 04, 2015, 03:50:16 PM

Title: [GH#3027] [img] with alt/height/width combines alt and height parameters
Post by: Joshua Dickerson on September 04, 2015, 03:50:16 PM
[img alt=Test height=100 width=100]http://avatars.simplemachinesweb.com/smf/avatar_23_1337883444.png[/img]


(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Favatars.simplemachinesweb.com%2Fsmf%2Favatar_23_1337883444.png&hash=ba7f46a5fe23a4f1554495142e927e70e874f24c)

<img src="http://avatars.simplemachinesweb.com/smf/avatar_23_1337883444.png" alt="Test height=100" width="100" class="bbc_img resized" style="cursor: pointer;">

What would be expected is:
<img src="http://avatars.simplemachinesweb.com/smf/avatar_23_1337883444.png" alt="Test" height="100" width="100" class="bbc_img resized" style="cursor: pointer;">
Title: Re: [img] with alt/height/width combines alt and height parameters
Post by: Shambles on September 04, 2015, 04:20:53 PM
I was under the impression that 'alt' text had to be enclosed within quotes to start with...?

[img alt="Test"...]
Title: Re: [img] with alt/height/width combines alt and height parameters
Post by: Joshua Dickerson on September 04, 2015, 04:26:28 PM
Nope, but thanks for reminding me. That's another part of the bug.

Code (input) Select
[img alt="Test" height=100 width=100]http://avatars.simplemachinesweb.com/smf/avatar_23_1337883444.png[/img]

Code (output) Select
<img src="http://avatars.simplemachinesweb.com/smf/avatar_23_1337883444.png" alt="&quot;Test&quot; height=100" width="100" class="bbc_img resized" style="cursor: pointer;">

Code (expected) Select
<img src="http://avatars.simplemachinesweb.com/smf/avatar_23_1337883444.png" alt="Test" height="100" width="100" class="bbc_img resized" style="cursor: pointer;">
Title: Re: [img] with alt/height/width combines alt and height parameters
Post by: Ninja ZX-10RR on September 05, 2015, 02:28:42 AM
/me follows
Title: Re: [img] with alt/height/width combines alt and height parameters
Post by: Oldiesmann on September 05, 2015, 02:09:26 PM
Tracked on GitHub as issue 3027: https://github.com/SimpleMachines/SMF2.1/issues/3027
Title: Re: [3027] [img] with alt/height/width combines alt and height parameters
Post by: Ninja ZX-10RR on September 05, 2015, 02:46:20 PM
Can this be included into 2.0.11 as well please? :)
Title: Re: [3027] [img] with alt/height/width combines alt and height parameters
Post by: Kindred on September 05, 2015, 03:56:55 PM
maybe....  however, it's such an unused feature that it has taken years for anyone to report it...
Title: Re: [3027] [img] with alt/height/width combines alt and height parameters
Post by: Joshua Dickerson on September 05, 2015, 05:50:35 PM
Yeah and I didn't find a fix yet so it would take time for them to fix it. If/when I find the fix, it will be easier to include it in the next release.
Title: Re: [3027] [img] with alt/height/width combines alt and height parameters
Post by: Illori on September 05, 2015, 06:28:18 PM
seem strange to anyone?

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+)'),
),
'content' => '<img src="$1" alt="{alt}" title="{title}"{width}{height} class="bbc_img resized">',


and in the resulting page source you see it in a different order?

<img class="bbc_img resized" width="100" title="" alt="Test height=100" src="http://avatars.simplemachinesweb.com/smf/avatar_23_1337883444.png" style="cursor: pointer;">

what is changing the order? alt should be before title then width and height with the class last.
Title: Re: [GH#3027] [img] with alt/height/width combines alt and height parameters
Post by: Joshua Dickerson on September 20, 2015, 10:40:58 PM
Uh, not sure how you're getting that output but I don't see it.
Title: Re: [GH#3027] [img] with alt/height/width combines alt and height parameters
Post by: Ninja ZX-10RR on September 21, 2015, 12:27:25 AM
Me neither...
Title: Re: [GH#3027] [img] with alt/height/width combines alt and height parameters
Post by: Antes on September 21, 2015, 04:49:37 AM
Another bug of chrome-based browsers?
Title: Re: [GH#3027] [img] with alt/height/width combines alt and height parameters
Post by: Illori on September 21, 2015, 05:09:01 AM
that was in firefox, so not a chrome bug.

also antes that is for bbc not for an avatar. so different things using different code.
Title: Re: [GH#3027] [img] with alt/height/width combines alt and height parameters
Post by: Ninja ZX-10RR on September 21, 2015, 05:54:08 AM
I was using Chrome in that screenshot, too :)
Title: Re: [GH#3027] [img] with alt/height/width combines alt and height parameters
Post by: Antes on September 21, 2015, 11:48:15 AM
Quote from: Illori on September 21, 2015, 05:09:01 AM
that was in firefox, so not a chrome bug.

also antes that is for bbc not for an avatar. so different things using different code.

the screenshot Ninja posted your avatar with chrome,
the screenshot I posted your avatar with firefox.
Title: Re: [GH#3027] [img] with alt/height/width combines alt and height parameters
Post by: Illori on September 21, 2015, 11:50:52 AM
the issue i am reporting is with an image posted in a TOPIC, it has NOTHING at all to do with any other image that shows up anywhere else.

this bug is reported on the img bbc tag.
Title: Re: [GH#3027] [img] with alt/height/width combines alt and height parameters
Post by: margarett on September 21, 2015, 12:24:37 PM
Over the discussion about the BBC parsing which might cause a huge memory consumption, I seem to remember someone (Spuds?) finding out that the current implementation doesn't return all possible permutations of the arguments. Maybe this is related?
Title: Re: [GH#3027] [img] with alt/height/width combines alt and height parameters
Post by: Ninja ZX-10RR on September 21, 2015, 05:33:52 PM
Could be, it's just way too old and would need to be somehow made "up-to-date" entirely, lol.
Title: Re: [GH#3027] [img] with alt/height/width combines alt and height parameters
Post by: Antes on January 06, 2017, 06:39:15 AM
Issue closed/resolved. If you are having such issues please open new topic while using latest build.
Title: Re: [GH#3027] [img] with alt/height/width combines alt and height parameters
Post by: Joshua Dickerson on January 07, 2017, 02:44:43 PM
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Favatars.simplemachinesweb.com%2Fsmf%2Favatar_23_1337883444.png&hash=ba7f46a5fe23a4f1554495142e927e70e874f24c)

What version is it updated in?
Title: Re: [GH#3027] [img] with alt/height/width combines alt and height parameters
Post by: Illori on January 07, 2017, 03:05:35 PM
the only version that is on github, SMF 2.1
Title: Re: [GH#3027] [img] with alt/height/width combines alt and height parameters
Post by: Joshua Dickerson on January 07, 2017, 03:08:13 PM
Do you have any tests to make sure it is still working?
Title: Re: [GH#3027] [img] with alt/height/width combines alt and height parameters
Post by: Illori on January 07, 2017, 03:20:44 PM
that is why it was posted here that it is fixed so that people are aware and can test and report back on github if there are any issues.
Title: Re: [GH#3027] [img] with alt/height/width combines alt and height parameters
Post by: Joshua Dickerson on January 22, 2017, 04:05:15 PM
I mean unit tests.