Skip to content

Commit 71ae61e

Browse files
committed
fixed php 5.3 support
1 parent e7129fe commit 71ae61e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Embed/RequestResolvers/Curl.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,16 @@ protected function resolve()
157157

158158
$this->content = '';
159159
$isBinary = null;
160+
$binaryContentTypes = self::$binaryContentTypes;
160161

161-
curl_setopt($connection, CURLOPT_HEADERFUNCTION, function ($connection, $string) use (&$isBinary) {
162+
curl_setopt($connection, CURLOPT_HEADERFUNCTION, function ($connection, $string) use (&$isBinary, $binaryContentTypes) {
162163
if (($isBinary === null) && strpos($string, ':')) {
163164
list($name, $value) = array_map('trim', explode(':', $string, 2));
164165

165166
if (strtolower($name) === 'content-type') {
166167
$isBinary = false;
167168

168-
foreach (self::$binaryContentTypes as $regex) {
169+
foreach ($binaryContentTypes as $regex) {
169170
if (preg_match($regex, strtolower($value))) {
170171
$isBinary = true;
171172
break;

0 commit comments

Comments
 (0)