Skip to content

Commit 9d48b4c

Browse files
committed
Migrate PEAR_Downloader away from php_errormsg
1 parent 7a8ac62 commit 9d48b4c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

PEAR/Downloader.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,8 @@ public static function _downloadHttp(
17121712
if (!$wp = @fopen($dest_file, 'wb')) {
17131713
fclose($fp);
17141714
if ($callback) {
1715-
call_user_func($callback, 'writefailed', array($dest_file, $php_errormsg));
1715+
call_user_func($callback, 'writefailed',
1716+
array($dest_file, error_get_last()["message"]));
17161717
}
17171718
return PEAR::raiseError("could not open $dest_file for writing");
17181719
}
@@ -1732,9 +1733,11 @@ public static function _downloadHttp(
17321733
if (!@fwrite($wp, $data)) {
17331734
fclose($fp);
17341735
if ($callback) {
1735-
call_user_func($callback, 'writefailed', array($dest_file, $php_errormsg));
1736+
call_user_func($callback, 'writefailed',
1737+
array($dest_file, error_get_last()["message"]));
17361738
}
1737-
return PEAR::raiseError("$dest_file: write failed ($php_errormsg)");
1739+
return PEAR::raiseError(
1740+
"$dest_file: write failed (" . error_get_last()["message"] . ")");
17381741
}
17391742
}
17401743

0 commit comments

Comments
 (0)