From e24226162db4fb707ab25598eab97e78eee55ad4 Mon Sep 17 00:00:00 2001 From: WanWizard Date: Sun, 15 Jul 2012 17:24:27 +0200 Subject: [PATCH] fixed getContext() choking on empty HTTP_PROXY environment variable Signed-off-by: WanWizard --- src/Composer/Util/StreamContextFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Util/StreamContextFactory.php b/src/Composer/Util/StreamContextFactory.php index f0621ee7d..382d7b932 100644 --- a/src/Composer/Util/StreamContextFactory.php +++ b/src/Composer/Util/StreamContextFactory.php @@ -32,9 +32,9 @@ final class StreamContextFactory $options = array('http' => array()); // Handle system proxy - if (isset($_SERVER['HTTP_PROXY']) || isset($_SERVER['http_proxy'])) { + if (!empty($_SERVER['HTTP_PROXY']) || !empty($_SERVER['http_proxy'])) { // Some systems seem to rely on a lowercased version instead... - $proxy = parse_url(isset($_SERVER['http_proxy']) ? $_SERVER['http_proxy'] : $_SERVER['HTTP_PROXY']); + $proxy = parse_url(!empty($_SERVER['http_proxy']) ? $_SERVER['http_proxy'] : $_SERVER['HTTP_PROXY']); } if (!empty($proxy)) {