Skip to content
This repository has been archived by the owner on Dec 16, 2020. It is now read-only.

Commit

Permalink
Fixes #193
Browse files Browse the repository at this point in the history
  • Loading branch information
mgp25 committed Sep 9, 2015
1 parent 1959bcc commit d9a98a7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/snapchat_agent.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,21 +457,21 @@ public function post($endpoint, $data, $params, $multipart = FALSE, $debug = FAL
exit();
}
}
}

if($endpoint == "/bq/get_captcha")
if($endpoint == "/bq/get_captcha")
{
file_put_contents(__DIR__."/captcha.zip", $result);
rewind($headerBuff);
$headers = stream_get_contents($headerBuff);
if(preg_match('/^Content-Disposition: .*?filename=(?<f>[^\s]+|\x22[^\x22]+\x22)\x3B?.*$/m', $headers, $matches))
{
file_put_contents(__DIR__."/captcha.zip", $result);
rewind($headerBuff);
$headers = stream_get_contents($headerBuff);
if(preg_match('/^Content-Disposition: .*?filename=(?<f>[^\s]+|\x22[^\x22]+\x22)\x3B?.*$/m', $headers, $matches))
{
$filename = trim($matches['f'],' ";');
rename(__DIR__."/captcha.zip", __DIR__."/{$filename}");
return $filename;
}
fclose($headerBuff);
return "captcha.zip";
$filename = trim($matches['f'],' ";');
rename(__DIR__."/captcha.zip", __DIR__."/{$filename}");
return $filename;
}
fclose($headerBuff);
return "captcha.zip";
}

$gi = curl_getinfo($ch);
Expand Down

0 comments on commit d9a98a7

Please sign in to comment.