diff options
author | Christian Hofmaier | 2017-04-12 14:30:18 +0200 |
---|---|---|
committer | Christian Hofmaier | 2017-04-12 14:30:18 +0200 |
commit | 9f27c7cdeb1df2f9c42373f419c6621d4faa71ca (patch) | |
tree | e55c6e1d95685df2117401e97f946b962f4e0f47 /inc/download.inc.php | |
parent | [permissionmanager] changed description to tooltips (diff) | |
parent | [rebootcontrol] New module for shutting down and rebooting clients (diff) | |
download | slx-admin-9f27c7cdeb1df2f9c42373f419c6621d4faa71ca.tar.gz slx-admin-9f27c7cdeb1df2f9c42373f419c6621d4faa71ca.tar.xz slx-admin-9f27c7cdeb1df2f9c42373f419c6621d4faa71ca.zip |
Merge branches 'master' and 'permission-manager' of git.openslx.org:openslx-ng/slx-admin into permission-manager
Diffstat (limited to 'inc/download.inc.php')
-rw-r--r-- | inc/download.inc.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/inc/download.inc.php b/inc/download.inc.php index 51601545..a2054f78 100644 --- a/inc/download.inc.php +++ b/inc/download.inc.php @@ -49,8 +49,8 @@ class Download curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $data = curl_exec($ch); $head = self::getContents($head); - if (preg_match('#^HTTP/\d+\.\d+ (\d+) #', $head, $out)) { - $code = (int) $out[1]; + if (preg_match_all('#^HTTP/\d+\.\d+ (\d+) #m', $head, $out)) { + $code = (int) array_pop($out[1]); } else { $code = 999; } @@ -83,8 +83,8 @@ class Download curl_setopt($ch, CURLOPT_POSTFIELDS, $string); $data = curl_exec($ch); $head = self::getContents($head); - if (preg_match('#^HTTP/\d+\.\d+ (\d+) #', $head, $out)) { - $code = (int) $out[1]; + if (preg_match_all('#^HTTP/\d+\.\d+ (\d+) #m', $head, $out)) { + $code = (int) array_pop($out[1]); } else { $code = 999; } @@ -116,8 +116,8 @@ class Download @unlink($target); return false; } - if (preg_match_all('#\bHTTP/\d+\.\d+ (\d+) #', $head, $out, PREG_SET_ORDER)) { - $code = (int) $out[count($out) - 1][1]; + if (preg_match_all('#^HTTP/\d+\.\d+ (\d+) #m', $head, $out)) { + $code = (int) array_pop($out[1]); } else { $code = '999 ' . curl_error($ch); } |