jjpljjpl Posted August 3, 2022 Share Posted August 3, 2022 Hello! We got a problem when try add shipment tracking url in back office in section transporter. The URL i am try to put is like this https://www.dbschenker.com/se-sv/om-oss/kundservice/spara-och-sok?language=sv&reference_type=*DWB&reference_number=@ We got error message The url field is invalid when try save. I'm guessing that Prestashop doesn't accept any characters in the url. How can we add characters to be accepted .alt increase the allowed length of the url if that should be the problem? Any idea? Link to comment Share on other sites More sharing options...
Ray UK Posted August 22, 2022 Share Posted August 22, 2022 (edited) It could be the * you have in the URL ....reference_type=*DWB&reference_number=@ I think it's strange that a wildcard is used in the URL Edited August 22, 2022 by MerseyRay (see edit history) Link to comment Share on other sites More sharing options...
jjpljjpl Posted August 23, 2022 Author Share Posted August 23, 2022 22 hours ago, MerseyRay said: It could be the * you have in the URL ....reference_type=*DWB&reference_number=@ I think it's strange that a wildcard is used in the URL It is not possible to make the code accept also the * ? Link to comment Share on other sites More sharing options...
ventura Posted August 27, 2022 Share Posted August 27, 2022 As the colleagues have commented it is quite strange that a url of this kind includes this type of characters. That field to record the carrier's url uses validation isAbsoluteUrl in classes/Validate.php You can make an override of this function, or create another one but it would be necessary to overwrite the Carrier.php class as well. With the function like this you should be able to register urls of this type. public static function isAbsoluteUrl($url) { if (!empty($url)) { return preg_match('/^(https?:)?\/\/[$~:;#,%&_=\(\)\[\]\.\? \+\-@\/a-zA-Z0-9\*]+$/', $url); } return true; } Or save the url directly in the database, table carrier, column url 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