Skip to content

Commit

Permalink
# [#32608] After update 2.5.14=>2.5.16 the com_update produces errors
Browse files Browse the repository at this point in the history
Thanks David Jardin
(Fix #2500)
  • Loading branch information
David Jardin authored and infograf768 committed Nov 13, 2013
1 parent d2ecfb3 commit 6375b10
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
3 changes: 3 additions & 0 deletions installation/CHANGELOG
Expand Up @@ -26,6 +26,9 @@ $ -> Language fix or change
- -> Removed
! -> Note

13-Nov-2013 Jean-Marie Simonet
# [#32608] After update 2.5.14=>2.5.16 the com_update produces errors Thanks David Jardin

12-Nov-2013 Jean-Marie Simonet
# [#30648] Incorrect ID for trash toolbar button when message is added Thanks Jurian Even
# [#29596] Inefficient code Thanks Ben tasker
Expand Down
24 changes: 23 additions & 1 deletion libraries/joomla/http/transport/stream.php
Expand Up @@ -121,8 +121,30 @@ public function request($method, JUri $uri, $data = null, array $headers = null,
// Create the stream context for the request.
$context = stream_context_create(array('http' => $options));

// Capture PHP errors
$php_errormsg = '';
$track_errors = ini_get('track_errors');
ini_set('track_errors', true);

// Open the stream for reading.
$stream = fopen((string) $uri, 'r', false, $context);
$stream = @fopen((string) $uri, 'r', false, $context);

if (!$stream)
{
if (!$php_errormsg)
{
// Error but nothing from php? Create our own
$php_errormsg = sprintf('Could not connect to resource: %s', $uri, $err, $errno);
}

// Restore error tracking to give control to the exception handler
ini_set('track_errors', $track_errors);

throw new RuntimeException($php_errormsg);
}

// Restore error tracking to what it was before.
ini_set('track_errors', $track_errors);

// Get the metadata for the stream, including response headers.
$metadata = stream_get_meta_data($stream);
Expand Down

0 comments on commit 6375b10

Please sign in to comment.