Page 1 of 1

Invalid URLs for "Edit" links

Posted: Mon Jan 09, 2012 11:50 pm
by Manko10
Hey guys!

The generated links for editing individual articles or sidebar plugins contain invalid characters.

The URLs look like this:

Code: Select all

http://www.example.com/serendipity_admin.php?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=edit&serendipity[id]=123
The square brackets are interpreted as array operators by PHP and therefore perfectly acceptable, but as such they're invalid URL characters and must therefore be URL encoded as %5B and %5D.

Re: Invalid URLs for "Edit" links

Posted: Tue Jan 10, 2012 3:41 pm
by garvinhicking
Hi!

Yeah, but this works in all browsers. We happily accept patches for this, but it's too much work to check in all places. If you have exact places or can provide a patch, we can commit this.

Otherwise, the work to fix this is in no relation to what it really "fixes" so it's really ultralow-priority for me.

Regards,
Garvin

Re: Invalid URLs for "Edit" links

Posted: Tue Jan 10, 2012 4:15 pm
by Manko10
Is this really in so many places? I just discovered it in these two cases: editing blog entries where I worked around it in the template with

Code: Select all

<a href="{$entry.link_edit|replace:"[":"%5B"|replace:"]":"%5D"}">{$CONST.EDIT_ENTRY}</a>
and for the sidebar modules where I don't have control over the links from the template.

Re: Invalid URLs for "Edit" links

Posted: Wed Jan 11, 2012 12:25 pm
by garvinhicking
Hi!

Doing such a replace is a bit nasty, we would need to do that at the place were it occurs, and also make sure it doesn't break things (link_edit should only be used in href's, if its used in input names, this would make problems).

Really, I think this is more of a non-issue and cosmetic thing...that would possibly cause more trouble than it solves.

Regads,
Garvin