Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1478 from robschley/master

Fixed a fatal error in JHttpTransportStream.
  • Loading branch information...
commit 8f38c9cefaaad28e72bab55f7afe049bf8e6c21e 2 parents 9f8a82c + a3f1fd8
@LouisLandry LouisLandry authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 libraries/joomla/http/transport/stream.php
View
12 libraries/joomla/http/transport/stream.php
@@ -123,7 +123,13 @@ public function request($method, JUri $uri, $data = null, array $headers = null,
$context = stream_context_create(array('http' => $options));
// Open the stream for reading.
- $stream = fopen((string) $uri, 'r', false, $context);
+ $stream = @fopen((string) $uri, 'r', false, $context);
+
+ // Check if the stream is open.
+ if (!$stream)
+ {
+ throw new RuntimeException(sprintf('Could not connect to resource: %s', $uri));
+ }
// Get the metadata for the stream, including response headers.
$metadata = stream_get_meta_data($stream);
@@ -181,9 +187,9 @@ protected function getResponse(array $headers, $body)
/**
* method to check if http transport stream available for using
- *
+ *
* @return bool true if available else false
- *
+ *
* @since 12.1
*/
static public function isSupported()

0 comments on commit 8f38c9c

Please sign in to comment.
Something went wrong with that request. Please try again.