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

Captcha doesn't work if not in debug #193

Closed
gosthell opened this issue Sep 9, 2015 · 0 comments
Closed

Captcha doesn't work if not in debug #193

gosthell opened this issue Sep 9, 2015 · 0 comments

Comments

@gosthell
Copy link

gosthell commented Sep 9, 2015

In snapchat_agent.php, the captcha zip file is only saved if $debug is set to true.

        if($debug)
        {
        ...
            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))
                {
                    $filename = trim($matches['f'],' ";');
                    rename(__DIR__."/captcha.zip", __DIR__."/{$filename}");
                    return $filename;
                }
                fclose($headerBuff);
                return "captcha.zip";
            }

This has to get out of the if($debug) statement.

@mgp25 mgp25 closed this as completed in d9a98a7 Sep 9, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant