? Pending

User tests: Successful: Unsuccessful:

avatar andrepereiradasilva
andrepereiradasilva
13 Dec 2015

Description

This PR cames from the problem identified in joomla-extensions/patchtester#111

This problem was identified in the patch tester but it's really a problem with any redirect with CURL on hosts with the conditions described (PHP open_basedir enabled).

How to test

You will need to setup PHP with open_basedir configured (go to php.ini file and search for open_basedir and put, for instance, open_basedir = /your/joomla/site/path/:/tmp/and restart php).

  1. Install Joomla latest version + Joomla Patch Tester (https://github.com/joomla-extensions/patchtester/releases) in that host
  2. Test if you can add a patch. You Can't.
  3. Go to /your/joomla/site/path/libraries/joomla/http/transport/ and replace all the code in curl.php file in that directory with this code https://raw.githubusercontent.com/andrepereiradasilva/joomla-cms/curl-followredirect-php-56/libraries/joomla/http/transport/curl.php
  4. Test if you can add a patch. You Can.

More info

avatar andrepereiradasilva andrepereiradasilva - open - 13 Dec 2015
avatar andrepereiradasilva andrepereiradasilva - change - 13 Dec 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 13 Dec 2015
Labels Added: ?
avatar andrepereiradasilva andrepereiradasilva - change - 13 Dec 2015
Title
Curl follow redirect in PHP 5.6.x (with open_basedir) should be allowed
Curl follow redirect in PHP 5.6.x+ (with open_basedir) should be allowed
avatar andrepereiradasilva andrepereiradasilva - change - 13 Dec 2015
Title
Curl follow redirect in PHP 5.6.x+ (with open_basedir) should be allowed
Curl follow redirect in PHP 5.6+ (with open_basedir) should be allowed
avatar andrepereiradasilva andrepereiradasilva - change - 23 Dec 2015
Title
Curl follow redirect in PHP 5.6+ (with open_basedir) should be allowed
Make Curl follow redirects (when PHP is configured with open_basedir)
avatar andrepereiradasilva
andrepereiradasilva - comment - 23 Dec 2015

Now patch work for all PHP versions (including PHP 5.5 or lower).
Test instructions updated and simplified.

avatar andrepereiradasilva andrepereiradasilva - change - 23 Dec 2015
The description was changed
Title
Curl follow redirect in PHP 5.6+ (with open_basedir) should be allowed
Make Curl follow redirects (when PHP is configured with open_basedir)
avatar andrepereiradasilva andrepereiradasilva - change - 27 Dec 2015
The description was changed
c30c659 27 Dec 2015 avatar andrepereiradasilva cs
avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Jan 2016

A similar change to solve this bug was already merged in Joomla Framework HTTP by mbabker.
joomla-framework/http@8f99ae6

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Jan 2016

@mbabker done.
Now only for PHP 5.3.10 or higher.

avatar andrepereiradasilva andrepereiradasilva - change - 7 Jan 2016
Title
Make Curl follow redirects (when PHP is configured with open_basedir)
JHttpFactory: Make Curl follow redirects (when PHP is configured with open_basedir)
avatar andrepereiradasilva andrepereiradasilva - change - 7 Jan 2016
Title
Make Curl follow redirects (when PHP is configured with open_basedir)
JHttpFactory: Make Curl follow redirects (when PHP is configured with open_basedir)
avatar wilsonge wilsonge - change - 17 Jan 2016
Milestone Added:
avatar Bodge-IT
Bodge-IT - comment - 27 Jan 2016

I tested this after having this exact issue testing #8645 on an installation on UKFast hosting.
I tested by following instructions above however the PHP on my installation was already set through PLESK php config to /var/www/vhosts/mydomain/:/tmp/ and checked as applied through System Info.
After installing J3.4.8 + Patchtester, I still couldn't install any patch.

avatar andrepereiradasilva
andrepereiradasilva - comment - 27 Jan 2016

Test this: Go to /var/www/vhosts/mydomain/libraries/joomla/http/transport/ and replace all the code in curl.php file in that directory with this code https://raw.githubusercontent.com/andrepereiradasilva/joomla-cms/curl-followredirect-php-56/libraries/joomla/http/transport/curl.php

And then try to apply other patches in the patch tester.

avatar Bodge-IT
Bodge-IT - comment - 28 Jan 2016

Test with code provided works AOK.

avatar andrepereiradasilva
andrepereiradasilva - comment - 28 Jan 2016
avatar Bodge-IT Bodge-IT - test_item - 28 Jan 2016 - Tested successfully
avatar Bodge-IT
Bodge-IT - comment - 28 Jan 2016

I have tested this item :white_check_mark: successfully on 749acda

Tested succesfully on UKFAST.
This was tested on 3.4.4 not 3.4.8
open_basedir appeared to be set correctly as verified in PHP info but still couldn't Apply Patches

After swapping code in libraries/joomla/http/transport/curl.php with code provide by @andrepereiradasilva

Patch Tester worked.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8676.

avatar Bodge-IT
Bodge-IT - comment - 28 Jan 2016

UKFast Hosting: PHP: 5.4.45

avatar andrepereiradasilva
andrepereiradasilva - comment - 28 Jan 2016

@Bodge-IT thanks for testing

avatar Bodge-IT
Bodge-IT - comment - 28 Jan 2016

OK Managed to replicate this issue on another server. Namesco.
Both these systems use Plesk to configure hosting.
In other test, UKFast, open_basedir was set to {WEBSPACEROOT}{/}{:}{TMP}{/} and couldn't apply patch.
On this test on Namesco server open_basedir was set to none and apply patches worked OK.
Setting it to the {WEBSPACEROOT}{/}{:}{TMP}{/} in PHP conifg broke patch tester. Applying the patch manually then fixed the issue.

avatar Bodge-IT Bodge-IT - test_item - 28 Jan 2016 - Tested successfully
avatar Bodge-IT
Bodge-IT - comment - 28 Jan 2016

I have tested this item :white_check_mark: successfully on 749acda

Tested on Namesco hosting.
Recreated issue by setting openbase_dir as per instructions.

New code worked like a charm.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8676.

avatar wilsonge
wilsonge - comment - 15 Feb 2016

Merged with ccb4c1f

avatar wilsonge wilsonge - change - 15 Feb 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-02-15 09:45:52
Closed_By wilsonge
avatar wilsonge wilsonge - close - 15 Feb 2016
avatar wilsonge wilsonge - close - 15 Feb 2016
avatar wilsonge wilsonge - reference | ccb4c1f - 15 Feb 16
avatar andrepereiradasilva andrepereiradasilva - head_ref_deleted - 15 Feb 2016

Add a Comment

Login with GitHub to post a comment