Fix CURLOPT_FOLLOWLOCATION bug with open_basedir or safe_mode restriction enabled.

Squashed commit of the following:

commit eaf4f43f687db59137a0b00bc0e12ed4eb0d0943
Merge: 1e9c5be 1e7d7bd
Author: Thomas Müller <thomas.mueller@tmit.eu>
Date:   Fri Mar 28 11:49:04 2014 +0100

    Merge branch 'master' of https://github.com/kev300/core into kev300-master

commit 1e7d7bdd8b5c7f301501cb822cdf2ef0ad3f2872
Author: kev300 <admin@gadeco.de>
Date:   Tue Dec 17 14:11:42 2013 +0100

    Update util.php

commit 3f0723f054a27a506be7f26932ccb54fff6f2be9
Author: kev300 <admin@gadeco.de>
Date:   Tue Dec 17 14:09:15 2013 +0100

    Update util.php

commit 512176abdcfbe5b2b060b91033abc9608912d1f8
Author: kev300 <admin@gadeco.de>
Date:   Tue Dec 17 14:02:04 2013 +0100

    Update util.php

commit 6cbefd080188d287024e0b047b88dd4525d6c2c1
Author: kev300 <admin@gadeco.de>
Date:   Mon Dec 16 16:44:46 2013 +0100

    Update util.php

    Fix CURLOPT_FOLLOWLOCATION bug with open_basedir or safe_mode restriction enabled.