dotproject / dotProject

Stable 2 series
Other
207 stars 106 forks source link

Login Issue : $AppUI->redirect swapps "&" with "&" #173

Open AlexBestoso opened 2 years ago

AlexBestoso commented 2 years ago

From doing some testing with a heavily modified version of dotproject, I encountered an issue regarding the redirect function post logging in.

Issue : If you have a link stored in an email, for example, that is formatted like :

http://localhost/dotproject/index.php?m=contracts&a=view&contract_id=2

If you click your link while your logged out, you'll be greeted by the login page. This is expected.

AFTER you loging, the redirect function will replace the "&" characters with "&". This prevents the end user from viewing what ever object it is that they have.

I was able to correct the issue with a simple adjustment to the CAppUI::redirect function.

The fix that worked for me was replacing

header('Location: index.php?' . $params);

with

header('Location: index.php?' . str_replace("&", "&", $params));

I believe the issue has something to do with the ob_implicit_flush() line right above and inspecting the $params variable before the hitting theheader() function shows that there's no "&" in the string.

The suggested fix worked for me, sharing to help the project.

AlexBestoso commented 2 years ago

git replaced my strings with actual ampersands.