ovy79ro Posted August 14, 2016 Share Posted August 14, 2016 (edited) Hi, I need to get URL parameter for an XML file, but Tools::getValue() removes backslash from URL ("D:\update_preturi\ral.xml" becomes "D:update_preturiral.xml"). The solution is to use $_POST or $_GET, but if i use them I don't pass the prestashop validation. What is the solution? Thank you! Edited August 14, 2016 by ovy79ro (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 15, 2016 Share Posted August 15, 2016 path you mentioned seems like it is not an url urls cant have backslash, only slashes Link to comment Share on other sites More sharing options...
ovy79ro Posted August 16, 2016 Author Share Posted August 16, 2016 You're right, solved! Link to comment Share on other sites More sharing options...
Appwards Posted September 4, 2020 Share Posted September 4, 2020 (edited) Actually Tools::getValue() isn't meant for any type of data in particular. The docstring reads: // Get a value from $_POST / $_GET // if unavailable, take a default value getValue() is being overly cautious, essential breaking perfectly valid (and properly encoded) url parameters and modifies them. If you need slashes in your URL parameters just use: $myVariable = ( isset($_GET['myVar']) ? $_GET['myVar'] : false); It's a bit more work, but it solves your problem. Edited September 4, 2020 by Appwards (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now