New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Code for sendHttpRequest for allow_url_fopen = 0 #793
Comments
Why 3 methods? Why not just use sockets if that's the lowest common denominator? Code comments re: socket version:
|
Replying to vipsoft:
Will update the code, but need to check a few things first. |
I've recoded the sendHttpRequest for sockets with your hints. Furthermore it should now meet the CodingStandard:
Works on my server ;) |
Thanks, it looks good (cursory inspection). I'll do a more complete review before commiting. I'm also going to throw in a couple of additional requirements. (You're welcome to tackle these as well.)
|
Alright, i've added the check for the parameter "content-length". If it is present, the data gets checked and if the two values are not equal, the output will be false again. Also removed two possible errors by initializing the variables $fgetsData and $streamMetaData.
If i have time in the next few days i will try to refactor fetchRemoteFile, but this will be at the weekend at the earliest. |
If you can, please attach your code as a diff. Thanks. |
did you check that it was working when doing the one click upgrade? |
I didn't test sendHttpRequest against the one-click upgrade as the code was tested against various types of content and servers. It does what it should do (as far as i have tested this function). Perhaps you mean fetchRemoteFile? I didn't have a look into it yet. |
Attachment: Patch of sendHttpRequest against 0.4.1 |
Added a patch against 0.4.1 with one addition, the array $streamMetaData needed to be initialized. |
(In [1369]) fixes #793 - rewrite sendHttpRequest() to work when allow_url_fopen=0; also refactor fetchRemoteFile |
I've changed the sendHttpRequest to allow checking for new versions on servers where allow_url_fopen equals zero. My code is tested on my server, and works as expected.
Open core/Piwik.php and replace sendHttpRequest by the following code:
Checks by curl if allow_url_fopen = 0. If curl is not available, it gets checked by a socket.
I hope this (or something similar) gets included into one of the next releases ;)
The text was updated successfully, but these errors were encountered: