Skip to content

Added handling redirections with curl if safe_mode or open_basedir is enabled. #21

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

Closed
wants to merge 2 commits into from

Conversation

r15ch13
Copy link

@r15ch13 r15ch13 commented Feb 17, 2012

Added handling redirections with curl if safe_mode or open_basedir is enabled.
See: http://de3.php.net/manual/de/function.curl-setopt.php#102121

*/
private function curl_exec_follow(/*resource*/ $ch, /*int*/ &$maxredirect = null) {
$mr = $maxredirect === null ? 5 : intval($maxredirect);
if (ini_get('open_basedir') == '' && ini_get('safe_mode' == 'Off')) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You copied the typo from the original comment. Should be:

if (ini_get('open_basedir') == '' && ini_get('safe_mode') == 'Off') {

@mattauckland
Copy link

I've just used @r15ch13 fix on my Linux system which is secured with ASL (Atomic Secured Linux), and his patch managed to allow me to use the script without having to disable open_basedir, which as you know isn't a great idea to disable as it would open you up to a world of security issues.

Thanks @r15ch13 you saved my bacon :)

tpyo added a commit that referenced this pull request Mar 4, 2014
@tpyo
Copy link
Owner

tpyo commented Mar 4, 2014

I'm terribly sorry that I haven't gotten around to testing this yet. I've copied your changes into fix/safemode-redirect for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants