@@ -30,6 +30,6 @@ |
||
30 | 30 | */ |
31 | 31 | public function isValidSimpleWrapper($email) |
32 | 32 | { |
33 | - return (boolean)preg_match('/^(.*<?)(.*)@(.*)(>?)$/', $email); |
|
33 | + return (boolean) preg_match('/^(.*<?)(.*)@(.*)(>?)$/', $email); |
|
34 | 34 | } |
35 | 35 | } |
@@ -77,9 +77,9 @@ |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | $count = ( |
80 | - count((array)$message->getTo()) |
|
81 | - + count((array)$message->getCc()) |
|
82 | - + count((array)$message->getBcc()) |
|
80 | + count((array) $message->getTo()) |
|
81 | + + count((array) $message->getCc()) |
|
82 | + + count((array) $message->getBcc()) |
|
83 | 83 | ); |
84 | 84 | |
85 | 85 | return $count; |
@@ -226,8 +226,8 @@ discard block |
||
226 | 226 | protected function createMessage1() |
227 | 227 | { |
228 | 228 | return self::NTLMSIG |
229 | - . $this->createByte('01') // Message 1 |
|
230 | - . $this->createByte('0702'); // Flags |
|
229 | + . $this->createByte('01') // Message 1 |
|
230 | + . $this->createByte('0702'); // Flags |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | /** |
@@ -255,19 +255,19 @@ discard block |
||
255 | 255 | $ntlmSec = $this->createSecurityBuffer($ntlmResponse, ($lmInfo[0] + $lmInfo[1]) / 2, true); |
256 | 256 | |
257 | 257 | return self::NTLMSIG |
258 | - . $this->createByte('03') // TYPE 3 message |
|
259 | - . $lmSec // LM response header |
|
260 | - . $ntlmSec // NTLM response header |
|
261 | - . $domainSec // Domain header |
|
262 | - . $userSec // User header |
|
263 | - . $workSec // Workstation header |
|
264 | - . $this->createByte('000000009a', 8) // session key header (empty) |
|
265 | - . $this->createByte('01020000') // FLAGS |
|
266 | - . $this->convertTo16bit($domain) // domain name |
|
267 | - . $this->convertTo16bit($username) // username |
|
268 | - . $this->convertTo16bit($workstation) // workstation |
|
269 | - . $lmResponse |
|
270 | - . $ntlmResponse; |
|
258 | + . $this->createByte('03') // TYPE 3 message |
|
259 | + . $lmSec // LM response header |
|
260 | + . $ntlmSec // NTLM response header |
|
261 | + . $domainSec // Domain header |
|
262 | + . $userSec // User header |
|
263 | + . $workSec // Workstation header |
|
264 | + . $this->createByte('000000009a', 8) // session key header (empty) |
|
265 | + . $this->createByte('01020000') // FLAGS |
|
266 | + . $this->convertTo16bit($domain) // domain name |
|
267 | + . $this->convertTo16bit($username) // username |
|
268 | + . $this->convertTo16bit($workstation) // workstation |
|
269 | + . $lmResponse |
|
270 | + . $ntlmResponse; |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | /** |
@@ -280,12 +280,12 @@ discard block |
||
280 | 280 | protected function createBlob($timestamp, $client, $targetInfo) |
281 | 281 | { |
282 | 282 | return $this->createByte('0101') |
283 | - . $this->createByte('00') |
|
284 | - . $timestamp |
|
285 | - . $client |
|
286 | - . $this->createByte('00') |
|
287 | - . $targetInfo |
|
288 | - . $this->createByte('00'); |
|
283 | + . $this->createByte('00') |
|
284 | + . $timestamp |
|
285 | + . $client |
|
286 | + . $this->createByte('00') |
|
287 | + . $targetInfo |
|
288 | + . $this->createByte('00'); |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | /** |
@@ -451,16 +451,16 @@ discard block |
||
451 | 451 | foreach ($material as $k => $v) { |
452 | 452 | $b = $this->castToByte(hexdec($v)); |
453 | 453 | $needsParity = ( |
454 | - ( |
|
455 | - $this->uRShift($b, 7) |
|
456 | - ^ $this->uRShift($b, 6) |
|
457 | - ^ $this->uRShift($b, 5) |
|
458 | - ^ $this->uRShift($b, 4) |
|
459 | - ^ $this->uRShift($b, 3) |
|
460 | - ^ $this->uRShift($b, 2) |
|
461 | - ^ $this->uRShift($b, 1) |
|
462 | - ) & 0x01 |
|
463 | - ) == 0; |
|
454 | + ( |
|
455 | + $this->uRShift($b, 7) |
|
456 | + ^ $this->uRShift($b, 6) |
|
457 | + ^ $this->uRShift($b, 5) |
|
458 | + ^ $this->uRShift($b, 4) |
|
459 | + ^ $this->uRShift($b, 3) |
|
460 | + ^ $this->uRShift($b, 2) |
|
461 | + ^ $this->uRShift($b, 1) |
|
462 | + ) & 0x01 |
|
463 | + ) == 0; |
|
464 | 464 | |
465 | 465 | list($high, $low) = str_split($v); |
466 | 466 |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | // pad to $bits bit |
86 | 86 | $bin_length = strlen($bin); |
87 | 87 | if ($bin_length < $bits) { |
88 | - $bin = str_repeat('0', $bits - $bin_length) . $bin; |
|
88 | + $bin = str_repeat('0', $bits - $bin_length).$bin; |
|
89 | 89 | } |
90 | 90 | } else { |
91 | 91 | // negative |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $bin = base_convert($si, 10, 2); |
94 | 94 | $bin_length = strlen($bin); |
95 | 95 | if ($bin_length > $bits) { |
96 | - $bin = str_repeat('1', $bits - $bin_length) . $bin; |
|
96 | + $bin = str_repeat('1', $bits - $bin_length).$bin; |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | { |
199 | 199 | list($domain, $username) = $this->getDomainAndUsername($username); |
200 | 200 | //$challenge, $context, $targetInfoH, $targetName, $domainName, $workstation, $DNSDomainName, $DNSServerName, $blob, $ter |
201 | - list($challenge, , , , , $workstation, , , $blob) = $this->parseMessage2($response); |
|
201 | + list($challenge,,,,, $workstation,,, $blob) = $this->parseMessage2($response); |
|
202 | 202 | |
203 | 203 | if (!$v2) { |
204 | 204 | // LMv1 |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | $desKey1 = $this->createDesKey($key1); |
330 | 330 | $desKey2 = $this->createDesKey($key2); |
331 | 331 | |
332 | - $constantDecrypt = $this->createByte($this->desEncrypt(self::DESCONST, $desKey1) . $this->desEncrypt(self::DESCONST, $desKey2), 21, false); |
|
332 | + $constantDecrypt = $this->createByte($this->desEncrypt(self::DESCONST, $desKey1).$this->desEncrypt(self::DESCONST, $desKey2), 21, false); |
|
333 | 333 | |
334 | 334 | // SECOND PART |
335 | 335 | list($key1, $key2, $key3) = str_split($constantDecrypt, 7); |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | $desKey2 = $this->createDesKey($key2); |
339 | 339 | $desKey3 = $this->createDesKey($key3); |
340 | 340 | |
341 | - return $this->desEncrypt($challenge, $desKey1) . $this->desEncrypt($challenge, $desKey2) . $this->desEncrypt($challenge, $desKey3); |
|
341 | + return $this->desEncrypt($challenge, $desKey1).$this->desEncrypt($challenge, $desKey2).$this->desEncrypt($challenge, $desKey3); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | /** |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | $desKey2 = $this->createDesKey($key2); |
360 | 360 | $desKey3 = $this->createDesKey($key3); |
361 | 361 | |
362 | - return $this->desEncrypt($challenge, $desKey1) . $this->desEncrypt($challenge, $desKey2) . $this->desEncrypt($challenge, $desKey3); |
|
362 | + return $this->desEncrypt($challenge, $desKey1).$this->desEncrypt($challenge, $desKey2).$this->desEncrypt($challenge, $desKey3); |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | /** |
@@ -402,9 +402,9 @@ discard block |
||
402 | 402 | // if $password > 15 than we can't use this method |
403 | 403 | if (strlen($password) <= 15) { |
404 | 404 | $ntlmHash = $this->md4Encrypt($password); |
405 | - $ntml2Hash = $this->md5Encrypt($ntlmHash, $this->convertTo16bit(strtoupper($username) . $domain)); |
|
405 | + $ntml2Hash = $this->md5Encrypt($ntlmHash, $this->convertTo16bit(strtoupper($username).$domain)); |
|
406 | 406 | |
407 | - $lmPass = bin2hex($this->md5Encrypt($ntml2Hash, $challenge . $client) . $client); |
|
407 | + $lmPass = bin2hex($this->md5Encrypt($ntml2Hash, $challenge.$client).$client); |
|
408 | 408 | } |
409 | 409 | |
410 | 410 | return $this->createByte($lmPass, 24); |
@@ -428,14 +428,14 @@ discard block |
||
428 | 428 | protected function createNTLMv2Hash($password, $username, $domain, $challenge, $targetInfo, $timestamp, $client) |
429 | 429 | { |
430 | 430 | $ntlmHash = $this->md4Encrypt($password); |
431 | - $ntml2Hash = $this->md5Encrypt($ntlmHash, $this->convertTo16bit(strtoupper($username) . $domain)); |
|
431 | + $ntml2Hash = $this->md5Encrypt($ntlmHash, $this->convertTo16bit(strtoupper($username).$domain)); |
|
432 | 432 | |
433 | 433 | // create blob |
434 | 434 | $blob = $this->createBlob($timestamp, $client, $targetInfo); |
435 | 435 | |
436 | - $ntlmv2Response = $this->md5Encrypt($ntml2Hash, $challenge . $blob); |
|
436 | + $ntlmv2Response = $this->md5Encrypt($ntml2Hash, $challenge.$blob); |
|
437 | 437 | |
438 | - return $ntlmv2Response . $blob; |
|
438 | + return $ntlmv2Response.$blob; |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | protected function createDesKey($key) |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | $len = strlen($key); |
445 | 445 | for ($i = 1; $i < $len; ++$i) { |
446 | 446 | list($high, $low) = str_split(bin2hex($key[$i])); |
447 | - $v = $this->castToByte(ord($key[$i - 1]) << (7 + 1 - $i) | $this->uRShift(hexdec(dechex(hexdec($high) & 0xf) . dechex(hexdec($low) & 0xf)), $i)); |
|
447 | + $v = $this->castToByte(ord($key[$i - 1]) << (7 + 1 - $i) | $this->uRShift(hexdec(dechex(hexdec($high) & 0xf).dechex(hexdec($low) & 0xf)), $i)); |
|
448 | 448 | $material[] = str_pad(substr(dechex($v), -2), 2, '0', STR_PAD_LEFT); // cast to byte |
449 | 449 | } |
450 | 450 | $material[] = str_pad(substr(dechex($this->castToByte(ord($key[6]) << 1)), -2), 2, '0'); |
@@ -467,9 +467,9 @@ discard block |
||
467 | 467 | list($high, $low) = str_split($v); |
468 | 468 | |
469 | 469 | if ($needsParity) { |
470 | - $material[$k] = dechex(hexdec($high) | 0x0) . dechex(hexdec($low) | 0x1); |
|
470 | + $material[$k] = dechex(hexdec($high) | 0x0).dechex(hexdec($low) | 0x1); |
|
471 | 471 | } else { |
472 | - $material[$k] = dechex(hexdec($high) & 0xf) . dechex(hexdec($low) & 0xe); |
|
472 | + $material[$k] = dechex(hexdec($high) & 0xf).dechex(hexdec($low) & 0xe); |
|
473 | 473 | } |
474 | 474 | } |
475 | 475 | |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | $length = $is16 ? $length / 2 : $length; |
494 | 494 | $length = $this->createByte(str_pad(dechex($length), 2, '0', STR_PAD_LEFT), 2); |
495 | 495 | |
496 | - return $length . $length . $this->createByte(dechex($offset), 4); |
|
496 | + return $length.$length.$this->createByte(dechex($offset), 4); |
|
497 | 497 | } |
498 | 498 | |
499 | 499 | /** |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | $ipadk = $key ^ str_repeat("\x36", $blocksize); |
597 | 597 | $opadk = $key ^ str_repeat("\x5c", $blocksize); |
598 | 598 | |
599 | - return pack('H*', md5($opadk . pack('H*', md5($ipadk . $msg)))); |
|
599 | + return pack('H*', md5($opadk.pack('H*', md5($ipadk.$msg)))); |
|
600 | 600 | } |
601 | 601 | |
602 | 602 | /** |
@@ -634,8 +634,8 @@ discard block |
||
634 | 634 | { |
635 | 635 | $message = bin2hex($message); |
636 | 636 | $messageId = substr($message, 16, 8); |
637 | - echo substr($message, 0, 16) . " NTLMSSP Signature<br />\n"; |
|
638 | - echo $messageId . " Type Indicator<br />\n"; |
|
637 | + echo substr($message, 0, 16)." NTLMSSP Signature<br />\n"; |
|
638 | + echo $messageId." Type Indicator<br />\n"; |
|
639 | 639 | |
640 | 640 | if ($messageId === '02000000') { |
641 | 641 | $map = array( |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | $data = $this->parseMessage2(\hex2bin($message)); |
655 | 655 | |
656 | 656 | foreach ($map as $key => $value) { |
657 | - echo bin2hex($data[$key]) . ' - ' . $data[$key] . ' ||| ' . $value . "<br />\n"; |
|
657 | + echo bin2hex($data[$key]).' - '.$data[$key].' ||| '.$value."<br />\n"; |
|
658 | 658 | } |
659 | 659 | } elseif ($messageId === '03000000') { |
660 | 660 | $i = 0; |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | ); |
698 | 698 | |
699 | 699 | foreach ($map as $key => $value) { |
700 | - echo $data[$key] . ' - ' . \hex2bin($data[$key]) . ' ||| ' . $value . "<br />\n"; |
|
700 | + echo $data[$key].' - '.\hex2bin($data[$key]).' ||| '.$value."<br />\n"; |
|
701 | 701 | } |
702 | 702 | } |
703 | 703 |
@@ -111,7 +111,7 @@ |
||
111 | 111 | if ($i !== null) { |
112 | 112 | $tree[-1] = min(count($replace) - 1, $i); |
113 | 113 | $tree[-2] = $last_size; |
114 | - $this->_treeMaxLen = (int)$size; |
|
114 | + $this->_treeMaxLen = (int) $size; |
|
115 | 115 | } |
116 | 116 | foreach ($replace as $rep) { |
117 | 117 | if (!is_array($rep)) { |
@@ -8,17 +8,17 @@ |
||
8 | 8 | * file that was distributed with this source code. |
9 | 9 | */ |
10 | 10 | |
11 | -require __DIR__ . '/classes/Swift.php'; |
|
11 | +require __DIR__.'/classes/Swift.php'; |
|
12 | 12 | |
13 | 13 | Swift::registerAutoload( |
14 | - function () { |
|
14 | + function() { |
|
15 | 15 | // Load in dependency maps |
16 | - require __DIR__ . '/dependency_maps/cache_deps.php'; |
|
17 | - require __DIR__ . '/dependency_maps/mime_deps.php'; |
|
18 | - require __DIR__ . '/dependency_maps/message_deps.php'; |
|
19 | - require __DIR__ . '/dependency_maps/transport_deps.php'; |
|
16 | + require __DIR__.'/dependency_maps/cache_deps.php'; |
|
17 | + require __DIR__.'/dependency_maps/mime_deps.php'; |
|
18 | + require __DIR__.'/dependency_maps/message_deps.php'; |
|
19 | + require __DIR__.'/dependency_maps/transport_deps.php'; |
|
20 | 20 | |
21 | 21 | // Load in global library preferences |
22 | - require __DIR__ . '/preferences.php'; |
|
22 | + require __DIR__.'/preferences.php'; |
|
23 | 23 | } |
24 | 24 | ); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require __DIR__ . '/../mime_types.php'; |
|
3 | +require __DIR__.'/../mime_types.php'; |
|
4 | 4 | |
5 | 5 | Swift_DependencyContainer::getInstance() |
6 | 6 | ->register('properties.charset') |
@@ -113,7 +113,7 @@ |
||
113 | 113 | */ |
114 | 114 | public function toString() |
115 | 115 | { |
116 | - return $this->_fieldName . ': ' . $this->_value; |
|
116 | + return $this->_fieldName.': '.$this->_value; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $angleAddrs = array(); |
157 | 157 | |
158 | 158 | foreach ($this->_ids as $id) { |
159 | - $angleAddrs[] = '<' . $id . '>'; |
|
159 | + $angleAddrs[] = '<'.$id.'>'; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | $this->setCachedValue(implode(' ', $angleAddrs)); |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | { |
177 | 177 | if ($this->_emailValidator->isValidSimpleWrapper($id) === false) { |
178 | 178 | throw new Swift_RfcComplianceException( |
179 | - 'Invalid ID given <' . $id . '>' |
|
179 | + 'Invalid ID given <'.$id.'>' |
|
180 | 180 | ); |
181 | 181 | } |
182 | 182 | } |
@@ -126,7 +126,7 @@ |
||
126 | 126 | { |
127 | 127 | if (!$this->getCachedValue()) { |
128 | 128 | if (isset($this->_address)) { |
129 | - $this->setCachedValue('<' . $this->_address . '>'); |
|
129 | + $this->setCachedValue('<'.$this->_address.'>'); |
|
130 | 130 | } |
131 | 131 | } |
132 | 132 |