Possible bug in old_url / Maybe I just don't know the code well enough.
March 08, 2014, 03:08:17 pm
In subs.php obExit, should $_SESSION['old_url'] really be updated after and xml request? Or should strpos($_SERVER['REQUEST_URL'], 'xml') === false be added to the list of checks not to update it? Is there another variable that says where someone came from to an action/page that doesn't get set to xml requests?
Re: Possible bug in old_url / Maybe I just don't know the code well enough.
Reply #1 – March 09, 2014, 08:58:59 am
emanuele
Global Moderator
Yep, that should be added indeed. Also, since there are several places where this old_url is set, wouldn't make more sense to create a function setOldUrl or something similar that does that?
Re: Possible bug in old_url / Maybe I just don't know the code well enough.
Reply #2 – March 09, 2014, 11:43:17 am
Functions are good. I finally had to do code edits to change the way permissions for posting and editing posts worked. action_post calls a checkPermissions function. Post2 does it all inline. And jsmodify does it all inline but mostly they are redundant as it puts most restrictions on the database jquery to basically enforce the permissions it later checks. Would have been great if they all called the permissions function in Messages.subs and if that had a hook to override them. But I know this is legacy from SMF and will be cleaned up over time.
Re: Possible bug in old_url / Maybe I just don't know the code well enough.
Reply #4 – March 09, 2014, 10:32:47 pm
Along the same lines, jsmodify calls functions like isAllowedTo() which checks permissions and if they fail redirects to an error page. Of course that error page is a standard html page not any kind of response expected over ajax so instead of the user seeing the error it seems like nothing happens. Note that's different than allowedTo which returns a bool (or equivalent) to the php.
Re: Possible bug in old_url / Maybe I just don't know the code well enough.
Reply #6 – March 10, 2014, 04:45:58 pm
Tried twice to post. Post button not working. Trying quick reply.
Re: Possible bug in old_url / Maybe I just don't know the code well enough.
Reply #7 – March 10, 2014, 04:47:52 pm
Odd. Trying normal post again. If the functions are going to live on then yes put on the list to make them output format aware.
Re: Possible bug in old_url / Maybe I just don't know the code well enough.
Reply #8 – February 04, 2015, 05:15:40 pm
emanuele
Global Moderator
Bump because it has been lost for too long.
Re: Possible bug in old_url / Maybe I just don't know the code well enough.
Reply #9 – February 07, 2015, 04:41:17 pm
On the OP, do we need to add ;api as well .. not sure if we ever call that without xml though
Re: Possible bug in old_url / Maybe I just don't know the code well enough.
Reply #10 – February 13, 2015, 02:41:06 pm
emanuele
Global Moderator
You are probably right, at least for consistency.
Re: Possible bug in old_url / Maybe I just don't know the code well enough.
Reply #13 – March 22, 2015, 04:10:36 pm
emanuele
Global Moderator
I can't see it in my repo (script.js line 614).