We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The 2nd argument in imap_delete() function in line 139 expects a string but int is given. Please fix by casting the type to string before passing.
public function getLastInstagramEmailContent(int $try = 1): string { $resource = @imap_open('{' . $this->getServer() . '/' . $this->getConnectionType() . '/ssl/novalidate-cert}INBOX', $this->getLogin(), $this->getPassword()) or die(implode(", ", @imap_errors())); if (!$resource) { throw new InstagramAuthException('Unable to open IMAP stream.'); } $numberMax = imap_num_msg($resource); $foundCode = false; $code = ''; // $numberMax = 0 when mailbox is empty if ($numberMax > 0) { // check into the last 3 mails for ($i = $numberMax; $i > ($numberMax - 3); $i--) { $body = imap_body($resource, $i); $body = quoted_printable_decode($body); $headers = imap_headerinfo($resource, $i, 0); preg_match('/<font size="6">([0-9]{6})<\/font>/s', $body, $match); $isMailFromInstagram = false; // confirm instagram is the mail sender if ( (property_exists($headers, 'fromaddress') && $headers->fromaddress === 'Instagram <security@mail.instagram.com>') || (isset($headers->from[0]) && property_exists($headers->from[0], 'host') && $headers->from[0]->host === 'mail.instagram.com') ) { $isMailFromInstagram = true; } if ($isMailFromInstagram && isset($match[1])) { imap_delete($resource, $i); $foundCode = true; $code = $match[1]; break; } } } imap_close($resource); // retry imap check (3 times max) if (!$foundCode && $try <= 3) { sleep(6); $code = $this->getLastInstagramEmailContent($try + 1); } return $code; }
The text was updated successfully, but these errors were encountered:
Same issue with PHP 8.1
Sorry, something went wrong.
Fixing () must be of type int in imap_delete() - resolves pgrimaud#349
e4ea1f8
d420ad2
pgrimaud
No branches or pull requests
The 2nd argument in imap_delete() function in line 139 expects a string but int is given. Please fix by casting the type to string before passing.
The text was updated successfully, but these errors were encountered: