@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $challenge = $agent->executeCommand("AUTH CRAM-MD5\r\n", array(334)); |
| 41 | 41 | $challenge = base64_decode(substr($challenge, 4)); |
| 42 | 42 | $message = base64_encode( |
| 43 | - $username . ' ' . $this->_getResponse($password, $challenge) |
|
| 43 | + $username.' '.$this->_getResponse($password, $challenge) |
|
| 44 | 44 | ); |
| 45 | 45 | $agent->executeCommand(sprintf("%s\r\n", $message), array(235)); |
| 46 | 46 | |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | $k_ipad = substr($secret, 0, 64) ^ str_repeat(chr(0x36), 64); |
| 74 | 74 | $k_opad = substr($secret, 0, 64) ^ str_repeat(chr(0x5C), 64); |
| 75 | 75 | |
| 76 | - $inner = pack('H32', md5($k_ipad . $challenge)); |
|
| 77 | - $digest = md5($k_opad . $inner); |
|
| 76 | + $inner = pack('H32', md5($k_ipad.$challenge)); |
|
| 77 | + $digest = md5($k_opad.$inner); |
|
| 78 | 78 | |
| 79 | 79 | return $digest; |
| 80 | 80 | } |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | { |
| 49 | 49 | try { |
| 50 | 50 | $param = $this->constructXOAuth2Params($email, $token); |
| 51 | - $agent->executeCommand('AUTH XOAUTH2 ' . $param . "\r\n", array(235)); |
|
| 51 | + $agent->executeCommand('AUTH XOAUTH2 '.$param."\r\n", array(235)); |
|
| 52 | 52 | |
| 53 | 53 | return true; |
| 54 | 54 | } catch (Swift_TransportException $e) { |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | // pad to $bits bit |
| 87 | 87 | $bin_length = strlen($bin); |
| 88 | 88 | if ($bin_length < $bits) { |
| 89 | - $bin = str_repeat('0', $bits - $bin_length) . $bin; |
|
| 89 | + $bin = str_repeat('0', $bits - $bin_length).$bin; |
|
| 90 | 90 | } |
| 91 | 91 | } else { |
| 92 | 92 | // negative |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $bin = base_convert($si, 10, 2); |
| 95 | 95 | $bin_length = strlen($bin); |
| 96 | 96 | if ($bin_length > $bits) { |
| 97 | - $bin = str_repeat('1', $bits - $bin_length) . $bin; |
|
| 97 | + $bin = str_repeat('1', $bits - $bin_length).$bin; |
|
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | } |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | { |
| 200 | 200 | list($domain, $username) = $this->getDomainAndUsername($username); |
| 201 | 201 | //$challenge, $context, $targetInfoH, $targetName, $domainName, $workstation, $DNSDomainName, $DNSServerName, $blob, $ter |
| 202 | - list($challenge, , , , , $workstation, , , $blob) = $this->parseMessage2($response); |
|
| 202 | + list($challenge,,,,, $workstation,,, $blob) = $this->parseMessage2($response); |
|
| 203 | 203 | |
| 204 | 204 | if (!$v2) { |
| 205 | 205 | // LMv1 |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | $desKey1 = $this->createDesKey($key1); |
| 326 | 326 | $desKey2 = $this->createDesKey($key2); |
| 327 | 327 | |
| 328 | - $constantDecrypt = $this->createByte($this->desEncrypt(self::DESCONST, $desKey1) . $this->desEncrypt(self::DESCONST, $desKey2), 21, false); |
|
| 328 | + $constantDecrypt = $this->createByte($this->desEncrypt(self::DESCONST, $desKey1).$this->desEncrypt(self::DESCONST, $desKey2), 21, false); |
|
| 329 | 329 | |
| 330 | 330 | // SECOND PART |
| 331 | 331 | list($key1, $key2, $key3) = str_split($constantDecrypt, 7); |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | $desKey2 = $this->createDesKey($key2); |
| 335 | 335 | $desKey3 = $this->createDesKey($key3); |
| 336 | 336 | |
| 337 | - return $this->desEncrypt($challenge, $desKey1) . $this->desEncrypt($challenge, $desKey2) . $this->desEncrypt($challenge, $desKey3); |
|
| 337 | + return $this->desEncrypt($challenge, $desKey1).$this->desEncrypt($challenge, $desKey2).$this->desEncrypt($challenge, $desKey3); |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | /** |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | $desKey2 = $this->createDesKey($key2); |
| 356 | 356 | $desKey3 = $this->createDesKey($key3); |
| 357 | 357 | |
| 358 | - return $this->desEncrypt($challenge, $desKey1) . $this->desEncrypt($challenge, $desKey2) . $this->desEncrypt($challenge, $desKey3); |
|
| 358 | + return $this->desEncrypt($challenge, $desKey1).$this->desEncrypt($challenge, $desKey2).$this->desEncrypt($challenge, $desKey3); |
|
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | /** |
@@ -400,9 +400,9 @@ discard block |
||
| 400 | 400 | // if $password > 15 than we can't use this method |
| 401 | 401 | if (strlen($password) <= 15) { |
| 402 | 402 | $ntlmHash = $this->md4Encrypt($password); |
| 403 | - $ntml2Hash = $this->md5Encrypt($ntlmHash, $this->convertTo16bit(strtoupper($username) . $domain)); |
|
| 403 | + $ntml2Hash = $this->md5Encrypt($ntlmHash, $this->convertTo16bit(strtoupper($username).$domain)); |
|
| 404 | 404 | |
| 405 | - $lmPass = bin2hex($this->md5Encrypt($ntml2Hash, $challenge . $client) . $client); |
|
| 405 | + $lmPass = bin2hex($this->md5Encrypt($ntml2Hash, $challenge.$client).$client); |
|
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | return $this->createByte($lmPass, 24); |
@@ -426,14 +426,14 @@ discard block |
||
| 426 | 426 | protected function createNTLMv2Hash($password, $username, $domain, $challenge, $targetInfo, $timestamp, $client) |
| 427 | 427 | { |
| 428 | 428 | $ntlmHash = $this->md4Encrypt($password); |
| 429 | - $ntml2Hash = $this->md5Encrypt($ntlmHash, $this->convertTo16bit(strtoupper($username) . $domain)); |
|
| 429 | + $ntml2Hash = $this->md5Encrypt($ntlmHash, $this->convertTo16bit(strtoupper($username).$domain)); |
|
| 430 | 430 | |
| 431 | 431 | // create blob |
| 432 | 432 | $blob = $this->createBlob($timestamp, $client, $targetInfo); |
| 433 | 433 | |
| 434 | - $ntlmv2Response = $this->md5Encrypt($ntml2Hash, $challenge . $blob); |
|
| 434 | + $ntlmv2Response = $this->md5Encrypt($ntml2Hash, $challenge.$blob); |
|
| 435 | 435 | |
| 436 | - return $ntlmv2Response . $blob; |
|
| 436 | + return $ntlmv2Response.$blob; |
|
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | protected function createDesKey($key) |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | $len = strlen($key); |
| 443 | 443 | for ($i = 1; $i < $len; ++$i) { |
| 444 | 444 | list($high, $low) = str_split(bin2hex($key[$i])); |
| 445 | - $v = $this->castToByte(ord($key[$i - 1]) << (7 + 1 - $i) | $this->uRShift(hexdec(dechex(hexdec($high) & 0xf) . dechex(hexdec($low) & 0xf)), $i)); |
|
| 445 | + $v = $this->castToByte(ord($key[$i - 1]) << (7 + 1 - $i) | $this->uRShift(hexdec(dechex(hexdec($high) & 0xf).dechex(hexdec($low) & 0xf)), $i)); |
|
| 446 | 446 | $material[] = str_pad(substr(dechex($v), -2), 2, '0', STR_PAD_LEFT); // cast to byte |
| 447 | 447 | } |
| 448 | 448 | $material[] = str_pad(substr(dechex($this->castToByte(ord($key[6]) << 1)), -2), 2, '0'); |
@@ -465,9 +465,9 @@ discard block |
||
| 465 | 465 | list($high, $low) = str_split($v); |
| 466 | 466 | |
| 467 | 467 | if ($needsParity) { |
| 468 | - $material[$k] = dechex(hexdec($high) | 0x0) . dechex(hexdec($low) | 0x1); |
|
| 468 | + $material[$k] = dechex(hexdec($high) | 0x0).dechex(hexdec($low) | 0x1); |
|
| 469 | 469 | } else { |
| 470 | - $material[$k] = dechex(hexdec($high) & 0xf) . dechex(hexdec($low) & 0xe); |
|
| 470 | + $material[$k] = dechex(hexdec($high) & 0xf).dechex(hexdec($low) & 0xe); |
|
| 471 | 471 | } |
| 472 | 472 | } |
| 473 | 473 | |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | $length = $is16 ? $length / 2 : $length; |
| 491 | 491 | $length = $this->createByte(str_pad(dechex($length), 2, '0', STR_PAD_LEFT), 2); |
| 492 | 492 | |
| 493 | - return $length . $length . $this->createByte(dechex($offset), 4); |
|
| 493 | + return $length.$length.$this->createByte(dechex($offset), 4); |
|
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | /** |
@@ -612,7 +612,7 @@ discard block |
||
| 612 | 612 | $ipadk = $key ^ str_repeat("\x36", $blocksize); |
| 613 | 613 | $opadk = $key ^ str_repeat("\x5c", $blocksize); |
| 614 | 614 | |
| 615 | - return pack('H*', md5($opadk . pack('H*', md5($ipadk . $msg)))); |
|
| 615 | + return pack('H*', md5($opadk.pack('H*', md5($ipadk.$msg)))); |
|
| 616 | 616 | } |
| 617 | 617 | |
| 618 | 618 | /** |
@@ -666,8 +666,8 @@ discard block |
||
| 666 | 666 | { |
| 667 | 667 | $message = bin2hex($message); |
| 668 | 668 | $messageId = substr($message, 16, 8); |
| 669 | - echo substr($message, 0, 16) . " NTLMSSP Signature<br />\n"; |
|
| 670 | - echo $messageId . " Type Indicator<br />\n"; |
|
| 669 | + echo substr($message, 0, 16)." NTLMSSP Signature<br />\n"; |
|
| 670 | + echo $messageId." Type Indicator<br />\n"; |
|
| 671 | 671 | |
| 672 | 672 | if ($messageId === '02000000') { |
| 673 | 673 | $map = array( |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | $data = $this->parseMessage2($this->hex2bin($message)); |
| 687 | 687 | |
| 688 | 688 | foreach ($map as $key => $value) { |
| 689 | - echo bin2hex($data[$key]) . ' - ' . $data[$key] . ' ||| ' . $value . "<br />\n"; |
|
| 689 | + echo bin2hex($data[$key]).' - '.$data[$key].' ||| '.$value."<br />\n"; |
|
| 690 | 690 | } |
| 691 | 691 | } elseif ($messageId === '03000000') { |
| 692 | 692 | $i = 0; |
@@ -729,7 +729,7 @@ discard block |
||
| 729 | 729 | ); |
| 730 | 730 | |
| 731 | 731 | foreach ($map as $key => $value) { |
| 732 | - echo $data[$key] . ' - ' . $this->hex2bin($data[$key]) . ' ||| ' . $value . "<br />\n"; |
|
| 732 | + echo $data[$key].' - '.$this->hex2bin($data[$key]).' ||| '.$value."<br />\n"; |
|
| 733 | 733 | } |
| 734 | 734 | } |
| 735 | 735 | |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | public function authenticate(Swift_Transport_SmtpAgent $agent, $username, $password) |
| 38 | 38 | { |
| 39 | 39 | try { |
| 40 | - $message = base64_encode($username . chr(0) . $username . chr(0) . $password); |
|
| 40 | + $message = base64_encode($username.chr(0).$username.chr(0).$password); |
|
| 41 | 41 | $agent->executeCommand(sprintf("AUTH PLAIN %s\r\n", $message), array(235)); |
| 42 | 42 | |
| 43 | 43 | return true; |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public function send(Swift_Mime_Message $message, &$failedRecipients = null) |
| 101 | 101 | { |
| 102 | - $failedRecipients = (array)$failedRecipients; |
|
| 102 | + $failedRecipients = (array) $failedRecipients; |
|
| 103 | 103 | $command = $this->getCommand(); |
| 104 | 104 | $buffer = $this->getBuffer(); |
| 105 | 105 | $count = 0; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (false === strpos($command, ' -f')) { |
| 119 | - $command .= ' -f' . escapeshellarg($this->_getReversePath($message)); |
|
| 119 | + $command .= ' -f'.escapeshellarg($this->_getReversePath($message)); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | $buffer->initialize(array_merge($this->_params, array('command' => $command))); |
@@ -127,9 +127,9 @@ discard block |
||
| 127 | 127 | $buffer->setWriteTranslations(array("\r\n" => "\n")); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - $count = count((array)$message->getTo()) |
|
| 131 | - + count((array)$message->getCc()) |
|
| 132 | - + count((array)$message->getBcc()); |
|
| 130 | + $count = count((array) $message->getTo()) |
|
| 131 | + + count((array) $message->getCc()) |
|
| 132 | + + count((array) $message->getBcc()); |
|
| 133 | 133 | |
| 134 | 134 | $message->toByteStream($buffer); |
| 135 | 135 | $buffer->flushBuffers(); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | } else { |
| 153 | 153 | $this->_throwException( |
| 154 | 154 | new Swift_TransportException( |
| 155 | - 'Unsupported sendmail command flags [' . $command . ']. ' . |
|
| 155 | + 'Unsupported sendmail command flags ['.$command.']. '. |
|
| 156 | 156 | 'Must be one of "-bs" or "-t" but can include additional flags.' |
| 157 | 157 | ) |
| 158 | 158 | ); |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | if (!$line) { |
| 184 | 184 | $metas = stream_get_meta_data($this->_out); |
| 185 | 185 | if ($metas['timed_out']) { |
| 186 | - throw new Swift_IoException('Connection to ' . $this->_getReadConnectionDescription() . ' Timed Out'); |
|
| 186 | + throw new Swift_IoException('Connection to '.$this->_getReadConnectionDescription().' Timed Out'); |
|
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $metas = stream_get_meta_data($this->_out); |
| 213 | 213 | if ($metas['timed_out']) { |
| 214 | 214 | throw new Swift_IoException( |
| 215 | - 'Connection to ' . $this->_getReadConnectionDescription() . ' Timed Out' |
|
| 215 | + 'Connection to '.$this->_getReadConnectionDescription().' Timed Out' |
|
| 216 | 216 | ); |
| 217 | 217 | } |
| 218 | 218 | } |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | $bytesWritten = fwrite($this->_in, substr($bytes, $totalBytesWritten)); |
| 254 | 254 | if (false === $bytesWritten || 0 === $bytesWritten) { |
| 255 | 255 | throw new Swift_IoException( |
| 256 | - 'Connection to ' . $this->_getReadConnectionDescription() . ' has gone away' |
|
| 256 | + 'Connection to '.$this->_getReadConnectionDescription().' has gone away' |
|
| 257 | 257 | ); |
| 258 | 258 | } |
| 259 | 259 | |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | |
| 278 | 278 | $host = $this->_params['host']; |
| 279 | 279 | if (!empty($this->_params['protocol'])) { |
| 280 | - $host = $this->_params['protocol'] . '://' . $host; |
|
| 280 | + $host = $this->_params['protocol'].'://'.$host; |
|
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | $timeout = 15; |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | if (!empty($this->_params['sourceIp'])) { |
| 289 | - $options['socket']['bindto'] = $this->_params['sourceIp'] . ':0'; |
|
| 289 | + $options['socket']['bindto'] = $this->_params['sourceIp'].':0'; |
|
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | if (isset($this->_params['stream_context_options'])) { |
@@ -294,10 +294,10 @@ discard block |
||
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | $streamContext = stream_context_create($options); |
| 297 | - $this->_stream = @stream_socket_client($host . ':' . $this->_params['port'], $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $streamContext); |
|
| 297 | + $this->_stream = @stream_socket_client($host.':'.$this->_params['port'], $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $streamContext); |
|
| 298 | 298 | |
| 299 | 299 | if (false === $this->_stream) { |
| 300 | - throw new Swift_TransportException('Connection could not be established with host ' . $this->_params['host'] . ' [' . $errstr . ' #' . $errno . ']'); |
|
| 300 | + throw new Swift_TransportException('Connection could not be established with host '.$this->_params['host'].' ['.$errstr.' #'.$errno.']'); |
|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | if (!empty($this->_params['blocking'])) { |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | |
| 329 | 329 | $err = stream_get_contents($pipes[2]); |
| 330 | 330 | if ($err) { |
| 331 | - throw new Swift_TransportException('Process could not be started [' . $err . ']'); |
|
| 331 | + throw new Swift_TransportException('Process could not be started ['.$err.']'); |
|
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | $this->_in = &$pipes[0]; |
@@ -339,16 +339,16 @@ discard block |
||
| 339 | 339 | { |
| 340 | 340 | switch ($this->_params['type']) { |
| 341 | 341 | case self::TYPE_PROCESS: |
| 342 | - return 'Process ' . $this->_params['command']; |
|
| 342 | + return 'Process '.$this->_params['command']; |
|
| 343 | 343 | break; |
| 344 | 344 | |
| 345 | 345 | case self::TYPE_SOCKET: |
| 346 | 346 | default: |
| 347 | 347 | $host = $this->_params['host']; |
| 348 | 348 | if (!empty($this->_params['protocol'])) { |
| 349 | - $host = $this->_params['protocol'] . '://' . $host; |
|
| 349 | + $host = $this->_params['protocol'].'://'.$host; |
|
| 350 | 350 | } |
| 351 | - $host .= ':' . $this->_params['port']; |
|
| 351 | + $host .= ':'.$this->_params['port']; |
|
| 352 | 352 | |
| 353 | 353 | return $host; |
| 354 | 354 | break; |
@@ -95,14 +95,14 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | public function setSignCertificate($certificate, $privateKey = null, $signOptions = PKCS7_DETACHED, $extraCerts = null) |
| 97 | 97 | { |
| 98 | - $this->signCertificate = 'file://' . str_replace('\\', '/', realpath($certificate)); |
|
| 98 | + $this->signCertificate = 'file://'.str_replace('\\', '/', realpath($certificate)); |
|
| 99 | 99 | |
| 100 | 100 | if (null !== $privateKey) { |
| 101 | 101 | if (is_array($privateKey)) { |
| 102 | 102 | $this->signPrivateKey = $privateKey; |
| 103 | - $this->signPrivateKey[0] = 'file://' . str_replace('\\', '/', realpath($privateKey[0])); |
|
| 103 | + $this->signPrivateKey[0] = 'file://'.str_replace('\\', '/', realpath($privateKey[0])); |
|
| 104 | 104 | } else { |
| 105 | - $this->signPrivateKey = 'file://' . str_replace('\\', '/', realpath($privateKey)); |
|
| 105 | + $this->signPrivateKey = 'file://'.str_replace('\\', '/', realpath($privateKey)); |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
@@ -131,10 +131,10 @@ discard block |
||
| 131 | 131 | $this->encryptCert = array(); |
| 132 | 132 | |
| 133 | 133 | foreach ($recipientCerts as $cert) { |
| 134 | - $this->encryptCert[] = 'file://' . str_replace('\\', '/', realpath($cert)); |
|
| 134 | + $this->encryptCert[] = 'file://'.str_replace('\\', '/', realpath($cert)); |
|
| 135 | 135 | } |
| 136 | 136 | } else { |
| 137 | - $this->encryptCert = 'file://' . str_replace('\\', '/', realpath($recipientCerts)); |
|
| 137 | + $this->encryptCert = 'file://'.str_replace('\\', '/', realpath($recipientCerts)); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | if (null !== $cipher) { |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | foreach ($headerLines as $headerLine) { |
| 381 | 381 | // Line separated |
| 382 | 382 | if (ctype_space($headerLines[0]) || false === strpos($headerLine, ':')) { |
| 383 | - $headers[$currentHeaderName] .= ' ' . trim($headerLine); |
|
| 383 | + $headers[$currentHeaderName] .= ' '.trim($headerLine); |
|
| 384 | 384 | continue; |
| 385 | 385 | } |
| 386 | 386 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | { |
| 202 | 202 | $this->_privateKey = $privateKey; |
| 203 | 203 | $this->_domainName = $domainName; |
| 204 | - $this->_signerIdentity = '@' . $domainName; |
|
| 204 | + $this->_signerIdentity = '@'.$domainName; |
|
| 205 | 205 | $this->_selector = $selector; |
| 206 | 206 | } |
| 207 | 207 | |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | // Prepare the DKIM-Signature |
| 550 | 550 | $params = array('v' => '1', 'a' => $this->_hashAlgorithm, 'bh' => base64_encode($this->_bodyHash), 'd' => $this->_domainName, 'h' => implode(': ', $this->_signedHeaders), 'i' => $this->_signerIdentity, 's' => $this->_selector); |
| 551 | 551 | if ($this->_bodyCanon != 'simple') { |
| 552 | - $params['c'] = $this->_headerCanon . '/' . $this->_bodyCanon; |
|
| 552 | + $params['c'] = $this->_headerCanon.'/'.$this->_bodyCanon; |
|
| 553 | 553 | } elseif ($this->_headerCanon != 'simple') { |
| 554 | 554 | $params['c'] = $this->_headerCanon; |
| 555 | 555 | } |
@@ -574,19 +574,19 @@ discard block |
||
| 574 | 574 | } |
| 575 | 575 | $string = ''; |
| 576 | 576 | foreach ($params as $k => $v) { |
| 577 | - $string .= $k . '=' . $v . '; '; |
|
| 577 | + $string .= $k.'='.$v.'; '; |
|
| 578 | 578 | } |
| 579 | 579 | $string = trim($string); |
| 580 | 580 | $headers->addTextHeader('DKIM-Signature', $string); |
| 581 | 581 | // Add the last DKIM-Signature |
| 582 | 582 | $tmp = $headers->getAll('DKIM-Signature'); |
| 583 | 583 | $this->_dkimHeader = end($tmp); |
| 584 | - $this->_addHeader(trim($this->_dkimHeader->toString()) . "\r\n b=", true); |
|
| 584 | + $this->_addHeader(trim($this->_dkimHeader->toString())."\r\n b=", true); |
|
| 585 | 585 | $this->_endOfHeaders(); |
| 586 | 586 | if ($this->_debugHeaders) { |
| 587 | 587 | $headers->addTextHeader('X-DebugHash', base64_encode($this->_headerHash)); |
| 588 | 588 | } |
| 589 | - $this->_dkimHeader->setValue($string . ' b=' . trim(chunk_split(base64_encode($this->_getEncryptedHash()), 73, ' '))); |
|
| 589 | + $this->_dkimHeader->setValue($string.' b='.trim(chunk_split(base64_encode($this->_getEncryptedHash()), 73, ' '))); |
|
| 590 | 590 | |
| 591 | 591 | return $this; |
| 592 | 592 | } |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | $name = Swift::strtolowerWithStaticCache(trim($exploded[0])); |
| 603 | 603 | $value = str_replace("\r\n", '', $exploded[1]); |
| 604 | 604 | $value = preg_replace("/[ \t][ \t]+/", ' ', $value); |
| 605 | - $header = $name . ':' . trim($value) . ($is_sig ? '' : "\r\n"); |
|
| 605 | + $header = $name.':'.trim($value).($is_sig ? '' : "\r\n"); |
|
| 606 | 606 | case 'simple': |
| 607 | 607 | // Nothing to do |
| 608 | 608 | } |
@@ -723,11 +723,11 @@ discard block |
||
| 723 | 723 | } |
| 724 | 724 | $pkeyId = openssl_get_privatekey($this->_privateKey); |
| 725 | 725 | if (!$pkeyId) { |
| 726 | - throw new Swift_SwiftException('Unable to load DKIM Private Key [' . openssl_error_string() . ']'); |
|
| 726 | + throw new Swift_SwiftException('Unable to load DKIM Private Key ['.openssl_error_string().']'); |
|
| 727 | 727 | } |
| 728 | 728 | if (openssl_sign($this->_headerCanonData, $signature, $pkeyId, $algorithm)) { |
| 729 | 729 | return $signature; |
| 730 | 730 | } |
| 731 | - throw new Swift_SwiftException('Unable to sign DKIM Hash [' . openssl_error_string() . ']'); |
|
| 731 | + throw new Swift_SwiftException('Unable to sign DKIM Hash ['.openssl_error_string().']'); |
|
| 732 | 732 | } |
| 733 | 733 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | { |
| 146 | 146 | $this->_privateKey = $privateKey; |
| 147 | 147 | $this->_domainName = $domainName; |
| 148 | - $this->_signerIdentity = '@' . $domainName; |
|
| 148 | + $this->_signerIdentity = '@'.$domainName; |
|
| 149 | 149 | $this->_selector = $selector; |
| 150 | 150 | } |
| 151 | 151 | |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | $params = array('a' => $this->_hashAlgorithm, 'b' => chunk_split(base64_encode($this->_getEncryptedHash()), 73, ' '), 'c' => $this->_canon, 'd' => $this->_domainName, 'h' => implode(': ', $this->_signedHeaders), 'q' => 'dns', 's' => $this->_selector); |
| 426 | 426 | $string = ''; |
| 427 | 427 | foreach ($params as $k => $v) { |
| 428 | - $string .= $k . '=' . $v . '; '; |
|
| 428 | + $string .= $k.'='.$v.'; '; |
|
| 429 | 429 | } |
| 430 | 430 | $string = trim($string); |
| 431 | 431 | $headers->addTextHeader('DomainKey-Signature', $string); |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | $name = Swift::strtolowerWithStaticCache(trim($exploded[0])); |
| 445 | 445 | $value = str_replace("\r\n", '', $exploded[1]); |
| 446 | 446 | $value = preg_replace("/[ \t][ \t]+/", ' ', $value); |
| 447 | - $header = $name . ':' . trim($value) . "\r\n"; |
|
| 447 | + $header = $name.':'.trim($value)."\r\n"; |
|
| 448 | 448 | case 'simple': |
| 449 | 449 | // Nothing to do |
| 450 | 450 | } |
@@ -544,11 +544,11 @@ discard block |
||
| 544 | 544 | $signature = ''; |
| 545 | 545 | $pkeyId = openssl_get_privatekey($this->_privateKey); |
| 546 | 546 | if (!$pkeyId) { |
| 547 | - throw new Swift_SwiftException('Unable to load DomainKey Private Key [' . openssl_error_string() . ']'); |
|
| 547 | + throw new Swift_SwiftException('Unable to load DomainKey Private Key ['.openssl_error_string().']'); |
|
| 548 | 548 | } |
| 549 | 549 | if (openssl_sign($this->_canonData, $signature, $pkeyId, OPENSSL_ALGO_SHA1)) { |
| 550 | 550 | return $signature; |
| 551 | 551 | } |
| 552 | - throw new Swift_SwiftException('Unable to sign DomainKey Hash [' . openssl_error_string() . ']'); |
|
| 552 | + throw new Swift_SwiftException('Unable to sign DomainKey Hash ['.openssl_error_string().']'); |
|
| 553 | 553 | } |
| 554 | 554 | } |