Skip to content

Commit

Permalink
Update problem_export_xml.php
Browse files Browse the repository at this point in the history
  • Loading branch information
zhblue authored Sep 21, 2023
1 parent c3b7222 commit 308c01d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions trunk/web/admin/problem_export_xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,8 @@ function image_base64_encode($img_url) {

if (substr($img_url,0,4)!="http")
return false;

$handle = @fopen($img_url, "rb");

$context = stream_context_create(array('http' => array('timeout' => 5))); // prevent stuck on export image failed
$handle = @fopen($img_url, "rb",false,$context);
if ($handle) {
$contents = stream_get_contents($handle);
$encoded_img = base64_encode($contents);
Expand Down

0 comments on commit 308c01d

Please sign in to comment.