@@ -51,6 +51,9 @@ |
||
| 51 | 51 | return $this->getContent($this->getUrl($qrtext, $size)); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | + /** |
|
| 55 | + * @param string $value |
|
| 56 | + */ |
|
| 54 | 57 | private function decodeColor($value) |
| 55 | 58 | { |
| 56 | 59 | return vsprintf('%d-%d-%d', sscanf($value, "%02x%02x%02x")); |
@@ -59,13 +59,13 @@ |
||
| 59 | 59 | public function getUrl($qrtext, $size) |
| 60 | 60 | { |
| 61 | 61 | return 'https://api.qrserver.com/v1/create-qr-code/' |
| 62 | - . '?size=' . $size . 'x' . $size |
|
| 63 | - . '&ecc=' . strtoupper($this->errorcorrectionlevel) |
|
| 64 | - . '&margin=' . $this->margin |
|
| 65 | - . '&qzone=' . $this->qzone |
|
| 66 | - . '&bgcolor=' . $this->decodeColor($this->bgcolor) |
|
| 67 | - . '&color=' . $this->decodeColor($this->color) |
|
| 68 | - . '&format=' . strtolower($this->format) |
|
| 69 | - . '&data=' . rawurlencode($qrtext); |
|
| 62 | + . '?size='.$size.'x'.$size |
|
| 63 | + . '&ecc='.strtoupper($this->errorcorrectionlevel) |
|
| 64 | + . '&margin='.$this->margin |
|
| 65 | + . '&qzone='.$this->qzone |
|
| 66 | + . '&bgcolor='.$this->decodeColor($this->bgcolor) |
|
| 67 | + . '&color='.$this->decodeColor($this->color) |
|
| 68 | + . '&format='.strtolower($this->format) |
|
| 69 | + . '&data='.rawurlencode($qrtext); |
|
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | \ No newline at end of file |
@@ -139,6 +139,7 @@ |
||
| 139 | 139 | |
| 140 | 140 | /** |
| 141 | 141 | * Get data-uri of QRCode |
| 142 | + * @param string $label |
|
| 142 | 143 | */ |
| 143 | 144 | public function getQRCodeImageAsDataUri($label, $secret, $size = 200) |
| 144 | 145 | { |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | $algorithm = strtolower(trim($algorithm)); |
| 38 | 38 | if (!in_array($algorithm, self::$_supportedalgos)) |
| 39 | - throw new TwoFactorAuthException('Unsupported algorithm: ' . $algorithm); |
|
| 39 | + throw new TwoFactorAuthException('Unsupported algorithm: '.$algorithm); |
|
| 40 | 40 | $this->algorithm = $algorithm; |
| 41 | 41 | $this->qrcodeprovider = $qrcodeprovider; |
| 42 | 42 | $this->rngprovider = $rngprovider; |
@@ -52,13 +52,13 @@ discard block |
||
| 52 | 52 | public function createSecret($bits = 80, $requirecryptosecure = true) |
| 53 | 53 | { |
| 54 | 54 | $secret = ''; |
| 55 | - $bytes = ceil($bits / 5); //We use 5 bits of each byte (since we have a 32-character 'alphabet' / BASE32) |
|
| 55 | + $bytes = ceil($bits / 5); //We use 5 bits of each byte (since we have a 32-character 'alphabet' / BASE32) |
|
| 56 | 56 | $rngprovider = $this->getRngprovider(); |
| 57 | 57 | if ($requirecryptosecure && !$rngprovider->isCryptographicallySecure()) |
| 58 | 58 | throw new TwoFactorAuthException('RNG provider is not cryptographically secure'); |
| 59 | 59 | $rnd = $rngprovider->getRandomBytes($bytes); |
| 60 | 60 | for ($i = 0; $i < $bytes; $i++) |
| 61 | - $secret .= self::$_base32[ord($rnd[$i]) & 31]; //Mask out left 3 bits for 0-31 values |
|
| 61 | + $secret .= self::$_base32[ord($rnd[$i]) & 31]; //Mask out left 3 bits for 0-31 values |
|
| 62 | 62 | return $secret; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -69,11 +69,11 @@ discard block |
||
| 69 | 69 | { |
| 70 | 70 | $secretkey = $this->base32Decode($secret); |
| 71 | 71 | |
| 72 | - $timestamp = "\0\0\0\0" . pack('N*', $this->getTimeSlice($this->getTime($time))); // Pack time into binary string |
|
| 73 | - $hashhmac = hash_hmac($this->algorithm, $timestamp, $secretkey, true); // Hash it with users secret key |
|
| 74 | - $hashpart = substr($hashhmac, ord(substr($hashhmac, -1)) & 0x0F, 4); // Use last nibble of result as index/offset and grab 4 bytes of the result |
|
| 75 | - $value = unpack('N', $hashpart); // Unpack binary value |
|
| 76 | - $value = $value[1] & 0x7FFFFFFF; // Drop MSB, keep only 31 bits |
|
| 72 | + $timestamp = "\0\0\0\0".pack('N*', $this->getTimeSlice($this->getTime($time))); // Pack time into binary string |
|
| 73 | + $hashhmac = hash_hmac($this->algorithm, $timestamp, $secretkey, true); // Hash it with users secret key |
|
| 74 | + $hashpart = substr($hashhmac, ord(substr($hashhmac, -1)) & 0x0F, 4); // Use last nibble of result as index/offset and grab 4 bytes of the result |
|
| 75 | + $value = unpack('N', $hashpart); // Unpack binary value |
|
| 76 | + $value = $value[1] & 0x7FFFFFFF; // Drop MSB, keep only 31 bits |
|
| 77 | 77 | |
| 78 | 78 | return str_pad($value % pow(10, $this->digits), $this->digits, '0', STR_PAD_LEFT); |
| 79 | 79 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | for ($i = -$discrepancy; $i <= $discrepancy; $i++) |
| 91 | 91 | $result |= $this->codeEquals($this->getCode($secret, $timetamp + ($i * $this->period)), $code); |
| 92 | 92 | |
| 93 | - return (bool)$result; |
|
| 93 | + return (bool) $result; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | // In general, it's not possible to prevent length leaks. So it's OK to leak the length. The important part is that |
| 104 | 104 | // we don't leak information about the difference of the two strings. |
| 105 | - if (strlen($safe)===strlen($user)) { |
|
| 105 | + if (strlen($safe) === strlen($user)) { |
|
| 106 | 106 | $result = 0; |
| 107 | 107 | for ($i = 0; $i < strlen($safe); $i++) |
| 108 | 108 | $result |= (ord($safe[$i]) ^ ord($user[$i])); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | private function getTimeSlice($time = null, $offset = 0) |
| 163 | 163 | { |
| 164 | - return (int)floor($time / $this->period) + ($offset * $this->period); |
|
| 164 | + return (int) floor($time / $this->period) + ($offset * $this->period); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
@@ -169,17 +169,17 @@ discard block |
||
| 169 | 169 | */ |
| 170 | 170 | public function getQRText($label, $secret) |
| 171 | 171 | { |
| 172 | - return 'otpauth://totp/' . rawurlencode($label) |
|
| 173 | - . '?secret=' . rawurlencode($secret) |
|
| 174 | - . '&issuer=' . rawurlencode($this->issuer) |
|
| 175 | - . '&period=' . intval($this->period) |
|
| 176 | - . '&algorithm=' . rawurlencode(strtoupper($this->algorithm)) |
|
| 177 | - . '&digits=' . intval($this->digits); |
|
| 172 | + return 'otpauth://totp/'.rawurlencode($label) |
|
| 173 | + . '?secret='.rawurlencode($secret) |
|
| 174 | + . '&issuer='.rawurlencode($this->issuer) |
|
| 175 | + . '&period='.intval($this->period) |
|
| 176 | + . '&algorithm='.rawurlencode(strtoupper($this->algorithm)) |
|
| 177 | + . '&digits='.intval($this->digits); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | private function base32Decode($value) |
| 181 | 181 | { |
| 182 | - if (strlen($value)==0) return ''; |
|
| 182 | + if (strlen($value) == 0) return ''; |
|
| 183 | 183 | |
| 184 | 184 | if (preg_match('/[^'.preg_quote(self::$_base32dict).']/', $value) !== 0) |
| 185 | 185 | throw new TwoFactorAuthException('Invalid base32 string'); |
@@ -200,7 +200,7 @@ |
||
| 200 | 200 | * Connect to a POP3 server. |
| 201 | 201 | * @access public |
| 202 | 202 | * @param string $host |
| 203 | - * @param integer|boolean $port |
|
| 203 | + * @param integer $port |
|
| 204 | 204 | * @param integer $tval |
| 205 | 205 | * @return boolean |
| 206 | 206 | */ |
@@ -169,13 +169,13 @@ discard block |
||
| 169 | 169 | if (false === $port) { |
| 170 | 170 | $this->port = $this->POP3_PORT; |
| 171 | 171 | } else { |
| 172 | - $this->port = (integer)$port; |
|
| 172 | + $this->port = (integer) $port; |
|
| 173 | 173 | } |
| 174 | 174 | // If no timeout value provided, use default |
| 175 | 175 | if (false === $timeout) { |
| 176 | 176 | $this->tval = $this->POP3_TIMEOUT; |
| 177 | 177 | } else { |
| 178 | - $this->tval = (integer)$timeout; |
|
| 178 | + $this->tval = (integer) $timeout; |
|
| 179 | 179 | } |
| 180 | 180 | $this->do_debug = $debug_level; |
| 181 | 181 | $this->username = $username; |
@@ -276,11 +276,11 @@ discard block |
||
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | // Send the Username |
| 279 | - $this->sendString("USER $username" . self::CRLF); |
|
| 279 | + $this->sendString("USER $username".self::CRLF); |
|
| 280 | 280 | $pop3_response = $this->getResponse(); |
| 281 | 281 | if ($this->checkResponse($pop3_response)) { |
| 282 | 282 | // Send the Password |
| 283 | - $this->sendString("PASS $password" . self::CRLF); |
|
| 283 | + $this->sendString("PASS $password".self::CRLF); |
|
| 284 | 284 | $pop3_response = $this->getResponse(); |
| 285 | 285 | if ($this->checkResponse($pop3_response)) { |
| 286 | 286 | return true; |
@@ -44,11 +44,11 @@ |
||
| 44 | 44 | public function getUrl($qrtext, $size) |
| 45 | 45 | { |
| 46 | 46 | return 'http://qrickit.com/api/qr' |
| 47 | - . '?qrsize=' . $size |
|
| 48 | - . '&e=' . strtolower($this->errorcorrectionlevel) |
|
| 49 | - . '&bgdcolor=' . $this->bgcolor |
|
| 50 | - . '&fgdcolor=' . $this->color |
|
| 51 | - . '&t=' . strtolower($this->format) |
|
| 52 | - . '&d=' . rawurlencode($qrtext); |
|
| 47 | + . '?qrsize='.$size |
|
| 48 | + . '&e='.strtolower($this->errorcorrectionlevel) |
|
| 49 | + . '&bgdcolor='.$this->bgcolor |
|
| 50 | + . '&fgdcolor='.$this->color |
|
| 51 | + . '&t='.strtolower($this->format) |
|
| 52 | + . '&d='.rawurlencode($qrtext); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | \ No newline at end of file |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | class CSRNGProvider implements IRNGProvider |
| 7 | 7 | { |
| 8 | 8 | public function getRandomBytes($bytecount) { |
| 9 | - return random_bytes($bytecount); // PHP7+ |
|
| 9 | + return random_bytes($bytecount); // PHP7+ |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | public function isCryptographicallySecure() { |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | $PHPMAILER_LANG['invalid_address'] = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: '; |
| 19 | 19 | $PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.'; |
| 20 | 20 | $PHPMAILER_LANG['provide_address'] = 'يجب توفير عنوان البريد الإلكتروني لمستلم واحد على الأقل.'; |
| 21 | -$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية ' . |
|
| 21 | +$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية '. |
|
| 22 | 22 | 'فشل في الارسال لكل من : '; |
| 23 | 23 | $PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: '; |
| 24 | 24 | $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() غير ممكن.'; |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | } elseif (substr_count($val, '$pre = ') > 0) { |
| 57 | 57 | $_SESSION['pre'] = getSettingValue($val); |
| 58 | 58 | } elseif (substr_count($val, "define('SECUREPATH',") > 0) { |
| 59 | - $_SESSION['sk_file'] = substr($val, 23, strpos($val, ');')-24)."/sk.php"; |
|
| 59 | + $_SESSION['sk_file'] = substr($val, 23, strpos($val, ');') - 24)."/sk.php"; |
|
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | } |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | |
| 93 | 93 | // Do clean |
| 94 | 94 | unlink($settings['bck_script_path'].'/'.$bck_filename.'.sql'); |
| 95 | - rename ( |
|
| 95 | + rename( |
|
| 96 | 96 | $settings['bck_script_path'].'/'.$bck_filename.'.encrypted.sql', |
| 97 | 97 | $settings['bck_script_path'].'/'.$bck_filename.'.sql' |
| 98 | 98 | ); |
@@ -227,21 +227,21 @@ discard block |
||
| 227 | 227 | break; |
| 228 | 228 | case 'html': |
| 229 | 229 | //Cleans up output a bit for a better looking, HTML-safe output |
| 230 | - echo gmdate('Y-m-d H:i:s') . ' ' . htmlentities( |
|
| 230 | + echo gmdate('Y-m-d H:i:s').' '.htmlentities( |
|
| 231 | 231 | preg_replace('/[\r\n]+/', '', $str), |
| 232 | 232 | ENT_QUOTES, |
| 233 | 233 | 'UTF-8' |
| 234 | - ) . "<br>\n"; |
|
| 234 | + )."<br>\n"; |
|
| 235 | 235 | break; |
| 236 | 236 | case 'echo': |
| 237 | 237 | default: |
| 238 | 238 | //Normalize line breaks |
| 239 | 239 | $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str); |
| 240 | - echo gmdate('Y-m-d H:i:s') . "\t" . str_replace( |
|
| 240 | + echo gmdate('Y-m-d H:i:s')."\t".str_replace( |
|
| 241 | 241 | "\n", |
| 242 | 242 | "\n \t ", |
| 243 | 243 | trim($str) |
| 244 | - ) . "\n"; |
|
| 244 | + )."\n"; |
|
| 245 | 245 | } |
| 246 | 246 | } |
| 247 | 247 | |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | } |
| 276 | 276 | // Connect to the SMTP server |
| 277 | 277 | $this->edebug( |
| 278 | - "Connection: opening to $host:$port, timeout=$timeout, options=" . |
|
| 278 | + "Connection: opening to $host:$port, timeout=$timeout, options=". |
|
| 279 | 279 | var_export($options, true), |
| 280 | 280 | self::DEBUG_CONNECTION |
| 281 | 281 | ); |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | $socket_context = stream_context_create($options); |
| 286 | 286 | set_error_handler(array($this, 'errorHandler')); |
| 287 | 287 | $this->smtp_conn = stream_socket_client( |
| 288 | - $host . ":" . $port, |
|
| 288 | + $host.":".$port, |
|
| 289 | 289 | $errno, |
| 290 | 290 | $errstr, |
| 291 | 291 | $timeout, |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | $errstr |
| 318 | 318 | ); |
| 319 | 319 | $this->edebug( |
| 320 | - 'SMTP ERROR: ' . $this->error['error'] |
|
| 320 | + 'SMTP ERROR: '.$this->error['error'] |
|
| 321 | 321 | . ": $errstr ($errno)", |
| 322 | 322 | self::DEBUG_CLIENT |
| 323 | 323 | ); |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | } |
| 337 | 337 | // Get any announcement |
| 338 | 338 | $announce = $this->get_lines(); |
| 339 | - $this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER); |
|
| 339 | + $this->edebug('SERVER -> CLIENT: '.$announce, self::DEBUG_SERVER); |
|
| 340 | 340 | return true; |
| 341 | 341 | } |
| 342 | 342 | |
@@ -406,9 +406,9 @@ discard block |
||
| 406 | 406 | return false; |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | - self::edebug('Auth method requested: ' . ($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL); |
|
| 409 | + self::edebug('Auth method requested: '.($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL); |
|
| 410 | 410 | self::edebug( |
| 411 | - 'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']), |
|
| 411 | + 'Auth methods available on the server: '.implode(',', $this->server_caps['AUTH']), |
|
| 412 | 412 | self::DEBUG_LOWLEVEL |
| 413 | 413 | ); |
| 414 | 414 | |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | $this->setError('No supported authentication methods found'); |
| 424 | 424 | return false; |
| 425 | 425 | } |
| 426 | - self::edebug('Auth method selected: ' . $authtype, self::DEBUG_LOWLEVEL); |
|
| 426 | + self::edebug('Auth method selected: '.$authtype, self::DEBUG_LOWLEVEL); |
|
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | if (!in_array($authtype, $this->server_caps['AUTH'])) { |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | // Send encoded username and password |
| 443 | 443 | if (!$this->sendCommand( |
| 444 | 444 | 'User & Password', |
| 445 | - base64_encode("\0" . $username . "\0" . $password), |
|
| 445 | + base64_encode("\0".$username."\0".$password), |
|
| 446 | 446 | 235 |
| 447 | 447 | ) |
| 448 | 448 | ) { |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | $oauth = $OAuth->getOauth64(); |
| 471 | 471 | |
| 472 | 472 | // Start authentication |
| 473 | - if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) { |
|
| 473 | + if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 '.$oauth, 235)) { |
|
| 474 | 474 | return false; |
| 475 | 475 | } |
| 476 | 476 | break; |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | |
| 502 | 502 | if (!$this->sendCommand( |
| 503 | 503 | 'AUTH NTLM', |
| 504 | - 'AUTH NTLM ' . base64_encode($msg1), |
|
| 504 | + 'AUTH NTLM '.base64_encode($msg1), |
|
| 505 | 505 | 334 |
| 506 | 506 | ) |
| 507 | 507 | ) { |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | $challenge = base64_decode(substr($this->last_reply, 4)); |
| 534 | 534 | |
| 535 | 535 | // Build the response |
| 536 | - $response = $username . ' ' . $this->hmac($challenge, $password); |
|
| 536 | + $response = $username.' '.$this->hmac($challenge, $password); |
|
| 537 | 537 | |
| 538 | 538 | // send encoded credentials |
| 539 | 539 | return $this->sendCommand('Username', base64_encode($response), 235); |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | $k_ipad = $key ^ $ipad; |
| 578 | 578 | $k_opad = $key ^ $opad; |
| 579 | 579 | |
| 580 | - return md5($k_opad . pack('H*', md5($k_ipad . $data))); |
|
| 580 | + return md5($k_opad.pack('H*', md5($k_ipad.$data))); |
|
| 581 | 581 | } |
| 582 | 582 | |
| 583 | 583 | /** |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | } |
| 690 | 690 | //If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1 |
| 691 | 691 | if ($in_headers) { |
| 692 | - $line = "\t" . $line; |
|
| 692 | + $line = "\t".$line; |
|
| 693 | 693 | } |
| 694 | 694 | } |
| 695 | 695 | $lines_out[] = $line; |
@@ -698,9 +698,9 @@ discard block |
||
| 698 | 698 | foreach ($lines_out as $line_out) { |
| 699 | 699 | //RFC2821 section 4.5.2 |
| 700 | 700 | if (!empty($line_out) and $line_out[0] == '.') { |
| 701 | - $line_out = '.' . $line_out; |
|
| 701 | + $line_out = '.'.$line_out; |
|
| 702 | 702 | } |
| 703 | - $this->client_send($line_out . self::CRLF); |
|
| 703 | + $this->client_send($line_out.self::CRLF); |
|
| 704 | 704 | } |
| 705 | 705 | } |
| 706 | 706 | |
@@ -727,7 +727,7 @@ discard block |
||
| 727 | 727 | public function hello($host = '') |
| 728 | 728 | { |
| 729 | 729 | //Try extended hello first (RFC 2821) |
| 730 | - return (boolean)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host)); |
|
| 730 | + return (boolean) ($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host)); |
|
| 731 | 731 | } |
| 732 | 732 | |
| 733 | 733 | /** |
@@ -741,7 +741,7 @@ discard block |
||
| 741 | 741 | */ |
| 742 | 742 | protected function sendHello($hello, $host) |
| 743 | 743 | { |
| 744 | - $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250); |
|
| 744 | + $noerror = $this->sendCommand($hello, $hello.' '.$host, 250); |
|
| 745 | 745 | $this->helo_rply = $this->last_reply; |
| 746 | 746 | if ($noerror) { |
| 747 | 747 | $this->parseHelloFields($hello); |
@@ -809,7 +809,7 @@ discard block |
||
| 809 | 809 | $useVerp = ($this->do_verp ? ' XVERP' : ''); |
| 810 | 810 | return $this->sendCommand( |
| 811 | 811 | 'MAIL FROM', |
| 812 | - 'MAIL FROM:<' . $from . '>' . $useVerp, |
|
| 812 | + 'MAIL FROM:<'.$from.'>'.$useVerp, |
|
| 813 | 813 | 250 |
| 814 | 814 | ); |
| 815 | 815 | } |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | { |
| 847 | 847 | return $this->sendCommand( |
| 848 | 848 | 'RCPT TO', |
| 849 | - 'RCPT TO:<' . $address . '>', |
|
| 849 | + 'RCPT TO:<'.$address.'>', |
|
| 850 | 850 | array(250, 251) |
| 851 | 851 | ); |
| 852 | 852 | } |
@@ -882,7 +882,7 @@ discard block |
||
| 882 | 882 | $this->setError("Command '$command' contained line breaks"); |
| 883 | 883 | return false; |
| 884 | 884 | } |
| 885 | - $this->client_send($commandstring . self::CRLF); |
|
| 885 | + $this->client_send($commandstring.self::CRLF); |
|
| 886 | 886 | |
| 887 | 887 | $this->last_reply = $this->get_lines(); |
| 888 | 888 | // Fetch SMTP code and possible error code explanation |
@@ -892,8 +892,8 @@ discard block |
||
| 892 | 892 | $code_ex = (count($matches) > 2 ? $matches[2] : null); |
| 893 | 893 | // Cut off error code from each response line |
| 894 | 894 | $detail = preg_replace( |
| 895 | - "/{$code}[ -]" . |
|
| 896 | - ($code_ex ? str_replace('.', '\\.', $code_ex) . ' ' : '') . "/m", |
|
| 895 | + "/{$code}[ -]". |
|
| 896 | + ($code_ex ? str_replace('.', '\\.', $code_ex).' ' : '')."/m", |
|
| 897 | 897 | '', |
| 898 | 898 | $this->last_reply |
| 899 | 899 | ); |
@@ -904,9 +904,9 @@ discard block |
||
| 904 | 904 | $detail = substr($this->last_reply, 4); |
| 905 | 905 | } |
| 906 | 906 | |
| 907 | - $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER); |
|
| 907 | + $this->edebug('SERVER -> CLIENT: '.$this->last_reply, self::DEBUG_SERVER); |
|
| 908 | 908 | |
| 909 | - if (!in_array($code, (array)$expect)) { |
|
| 909 | + if (!in_array($code, (array) $expect)) { |
|
| 910 | 910 | $this->setError( |
| 911 | 911 | "$command command failed", |
| 912 | 912 | $detail, |
@@ -914,7 +914,7 @@ discard block |
||
| 914 | 914 | $code_ex |
| 915 | 915 | ); |
| 916 | 916 | $this->edebug( |
| 917 | - 'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply, |
|
| 917 | + 'SMTP ERROR: '.$this->error['error'].': '.$this->last_reply, |
|
| 918 | 918 | self::DEBUG_CLIENT |
| 919 | 919 | ); |
| 920 | 920 | return false; |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | public function turn() |
| 977 | 977 | { |
| 978 | 978 | $this->setError('The SMTP TURN command is not implemented'); |
| 979 | - $this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT); |
|
| 979 | + $this->edebug('SMTP NOTICE: '.$this->error['error'], self::DEBUG_CLIENT); |
|
| 980 | 980 | return false; |
| 981 | 981 | } |
| 982 | 982 | |
@@ -1102,7 +1102,7 @@ discard block |
||
| 1102 | 1102 | $info = stream_get_meta_data($this->smtp_conn); |
| 1103 | 1103 | if ($info['timed_out']) { |
| 1104 | 1104 | $this->edebug( |
| 1105 | - 'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)', |
|
| 1105 | + 'SMTP -> get_lines(): timed-out ('.$this->Timeout.' sec)', |
|
| 1106 | 1106 | self::DEBUG_LOWLEVEL |
| 1107 | 1107 | ); |
| 1108 | 1108 | break; |
@@ -1110,8 +1110,8 @@ discard block |
||
| 1110 | 1110 | // Now check if reads took too long |
| 1111 | 1111 | if ($endtime and time() > $endtime) { |
| 1112 | 1112 | $this->edebug( |
| 1113 | - 'SMTP -> get_lines(): timelimit reached (' . |
|
| 1114 | - $this->Timelimit . ' sec)', |
|
| 1113 | + 'SMTP -> get_lines(): timelimit reached ('. |
|
| 1114 | + $this->Timelimit.' sec)', |
|
| 1115 | 1115 | self::DEBUG_LOWLEVEL |
| 1116 | 1116 | ); |
| 1117 | 1117 | break; |
@@ -1225,7 +1225,7 @@ discard block |
||
| 1225 | 1225 | $errmsg |
| 1226 | 1226 | ); |
| 1227 | 1227 | $this->edebug( |
| 1228 | - $notice . ' Error #' . $errno . ': ' . $errmsg . " [$errfile line $errline]", |
|
| 1228 | + $notice.' Error #'.$errno.': '.$errmsg." [$errfile line $errline]", |
|
| 1229 | 1229 | self::DEBUG_CONNECTION |
| 1230 | 1230 | ); |
| 1231 | 1231 | } |