? Pending

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
20 May 2017

Summary of Changes

If the link was internal, the resultant output would be

<a href="http://example.com/internal" >http://example.com/internal</a>

note the extra space

Expected result

<a href="http://example.com/internal">http://example.com/internal</a>
avatar PhilETaylor PhilETaylor - open - 20 May 2017
avatar PhilETaylor PhilETaylor - change - 20 May 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 20 May 2017
Category Front End Plugins
avatar PhilETaylor PhilETaylor - change - 20 May 2017
The description was changed
avatar PhilETaylor PhilETaylor - edited - 20 May 2017
avatar PhilETaylor PhilETaylor - change - 20 May 2017
Title
Ensure there are correct spaces in tag if attributes not used
[com_fields] Ensure there are correct spaces in tag if attributes not used
avatar PhilETaylor PhilETaylor - edited - 20 May 2017
avatar brianteeman
brianteeman - comment - 20 May 2017

I think you mean if the link IS internal then you have an extra space
screenshotr19-35-44

avatar PhilETaylor PhilETaylor - comment - 20 May 2017
avatar brianteeman
brianteeman - comment - 20 May 2017

I agree with the first part of the change as that fixes the bug but the second part looks like its just a different way of writing the same code and to me at least it looks harder to read. - maybe I am missing something

avatar PhilETaylor PhilETaylor - comment - 20 May 2017
avatar Bakual
Bakual - comment - 20 May 2017

The use of sprintf actually makes it far easier to read (to developers),

That's a bold statement which I wouldn't sign ?
I find it harder to read as I have to first look what you're passing in and then back to see where you're passing it in. While it currently is just a simple concatenation of a string which anyone can read as it is.

But one question, why don't you use %1$s and %2$s? This way you wouldn't have to specify the htmlspecialchars($value) a second time, you could just reuse the first one.

with its use, this bug would never have been introduced!

I don't see why this bug couldn't be introduced when you use sprintf. The exact same error could have been done there as well (having a space in the sprintf "format").

avatar PhilETaylor PhilETaylor - comment - 20 May 2017
avatar Bakual
Bakual - comment - 20 May 2017

Funnily not one person, including you, complained about its exact same use in #16135

I shrugged it off as personal flavor, not worth discussing.
Two differences:

  • You didn't make that statement there that it is far easier to read and less error prone (which I don't agree but as said, personal flavor)
  • You don't repeat an argument there, hence my serious question why you're not using %1$s here so you don't have to repeat the htmlspecialchars($value).
avatar PhilETaylor PhilETaylor - comment - 20 May 2017
avatar Quy
Quy - comment - 20 May 2017

I have tested this item successfully on ca1c2d7


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16155.

avatar Quy Quy - test_item - 20 May 2017 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 23 May 2017

@PhilETaylor how to get Attributes not used in "Fields - URL"?

avatar brianteeman
brianteeman - comment - 23 May 2017

A url to a page on your own site is.an internal link and will not have the extra attributes that a link to someone else's site has

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 23 May 2017

I have tested this item successfully on ca1c2d7


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16155.

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 23 May 2017 - Tested successfully
avatar franz-wohlkoenig franz-wohlkoenig - change - 23 May 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 23 May 2017

RTC after two successful tests.

avatar rdeutz rdeutz - change - 23 May 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-05-23 19:11:57
Closed_By rdeutz
Labels Added: ?
avatar rdeutz rdeutz - close - 23 May 2017
avatar rdeutz rdeutz - merge - 23 May 2017

Add a Comment

Login with GitHub to post a comment