PDA

View Full Version : Shell execute forcing string to lower case causing URL to fail



Movian
02-22-2016, 03:37 PM
Hey,

so I have been using this fantastic little function for some time. I have to pass some URL strings this way as application.followhyperlink was casuing some problems with cookies as it doesn't just pass the URL to the browser it aparently tries to process the link and then passes the result of that to the browser that caused authentication issues.

Any way today we start having clients calling in because a web link had stopped working at first I thought it was on the web sites end but it appears that on SOME machines the url is now some how being modified with something akin to lcase while on others it passes through as intended.


E.G https://www.website.com/com.AphroditeServlet?page-type=E_NETWORK&partner-id=DEFAULT

becomes https://www.website.com/com.aphroditeservlet?page-type=e_network&partner-id=default

causing the page to throw an error....

has anyone heard anything or have any ideas what may be causing this odd behavior?



Private Declare Function ShellExecute _
Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hWnd As Long, _
ByVal Operation As String, _
ByVal filename As String, _
Optional ByVal Parameters As String, _
Optional ByVal Directory As String, _
Optional ByVal WindowStyle As Long = vbMinimizedFocus _
) As Long


Public Function OpenUrl(URL As String) As Long
OpenUrl = ShellExecute(0, "Open", URL, , , 3)
End Function

Anehab
02-22-2016, 04:10 PM
maybe using UCASE() to return the URL in all uppercase?

Movian
02-22-2016, 04:14 PM
it needs to be formatted as it's passed with lower case as lower case and upper case as upper case....

so I can't just ucase the whole thing....

jonh
02-23-2016, 04:03 AM
Try redirecting from a local file?



<html><head><meta http-equiv="refresh" content="0; url=https://www.website.com/com.Aphrodit...ner-id=DEFAULT" /></head><body>redirecting...</body></html>

Movian
02-23-2016, 06:10 AM
so create a temporary html doc and then shell execute the doc?

hmmm that could work

Perhaps I could create a shortcut to the site too and shell that out?

I will look at those options as a patch but I hope I can find out why this has suddenly stopped working :(

Thanks for giving me fix ideas Jonh :)