@@ -578,13 +578,13 @@ discard block |
||
| 578 | 578 | $sender = user_load($sender->uid); |
| 579 | 579 | |
| 580 | 580 | switch ($status) { |
| 581 | - case FLAG_FRIEND_FLAGGED: |
|
| 582 | - // Sender accepted recipient's friend request |
|
| 583 | - $email['subject'] = bts('!name accepted your friend request [!site]', array( |
|
| 584 | - '!name' => $sender->boincuser_name, |
|
| 585 | - '!site' => variable_get('site_name', ''), |
|
| 586 | - )); |
|
| 587 | - $email['body'] = bts('!name confirmed you as a friend on !site. |
|
| 581 | + case FLAG_FRIEND_FLAGGED: |
|
| 582 | + // Sender accepted recipient's friend request |
|
| 583 | + $email['subject'] = bts('!name accepted your friend request [!site]', array( |
|
| 584 | + '!name' => $sender->boincuser_name, |
|
| 585 | + '!site' => variable_get('site_name', ''), |
|
| 586 | + )); |
|
| 587 | + $email['body'] = bts('!name confirmed you as a friend on !site. |
|
| 588 | 588 | |
| 589 | 589 | Follow this link to view his or her profile: |
| 590 | 590 | !link |
@@ -593,17 +593,17 @@ discard block |
||
| 593 | 593 | |
| 594 | 594 | Thanks, |
| 595 | 595 | The !site team', array( |
| 596 | - '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
| 597 | - '!site' => variable_get('site_name', ''), |
|
| 598 | - '!message' => $flag->friend_message ? bts('Message') . ': ' . $flag->friend_message : '', |
|
| 599 | - '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
|
| 600 | - )); |
|
| 601 | - break; |
|
| 596 | + '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
| 597 | + '!site' => variable_get('site_name', ''), |
|
| 598 | + '!message' => $flag->friend_message ? bts('Message') . ': ' . $flag->friend_message : '', |
|
| 599 | + '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
|
| 600 | + )); |
|
| 601 | + break; |
|
| 602 | 602 | |
| 603 | - case FLAG_FRIEND_PENDING: |
|
| 604 | - // Sender is requesting to be recipient's friend |
|
| 605 | - $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', ''))); |
|
| 606 | - $email['body'] = bts('!name added you as a friend on !site. You can approve or deny this request. Denying a request will not send a notification, but will remove the request from both of your accounts. |
|
| 603 | + case FLAG_FRIEND_PENDING: |
|
| 604 | + // Sender is requesting to be recipient's friend |
|
| 605 | + $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', ''))); |
|
| 606 | + $email['body'] = bts('!name added you as a friend on !site. You can approve or deny this request. Denying a request will not send a notification, but will remove the request from both of your accounts. |
|
| 607 | 607 | |
| 608 | 608 | Follow the link below to view this request: |
| 609 | 609 | !link |
@@ -612,12 +612,12 @@ discard block |
||
| 612 | 612 | |
| 613 | 613 | Thanks, |
| 614 | 614 | The !site team', array( |
| 615 | - '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
| 616 | - '!site' => variable_get('site_name', ''), |
|
| 617 | - '!message' => $flag->friend_message ? bts('Message') . ': ' . $flag->friend_message : '', |
|
| 618 | - '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
|
| 619 | - )); |
|
| 620 | - break; |
|
| 615 | + '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
| 616 | + '!site' => variable_get('site_name', ''), |
|
| 617 | + '!message' => $flag->friend_message ? bts('Message') . ': ' . $flag->friend_message : '', |
|
| 618 | + '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
|
| 619 | + )); |
|
| 620 | + break; |
|
| 621 | 621 | } |
| 622 | 622 | return $email; |
| 623 | 623 | } |
@@ -221,28 +221,28 @@ discard block |
||
| 221 | 221 | return; |
| 222 | 222 | } |
| 223 | 223 | switch ($this->Debugoutput) { |
| 224 | - case 'error_log': |
|
| 225 | - //Don't output, just log |
|
| 226 | - error_log($str); |
|
| 227 | - break; |
|
| 228 | - case 'html': |
|
| 229 | - //Cleans up output a bit for a better looking, HTML-safe output |
|
| 230 | - echo htmlentities( |
|
| 231 | - preg_replace('/[\r\n]+/', '', $str), |
|
| 232 | - ENT_QUOTES, |
|
| 233 | - 'UTF-8' |
|
| 234 | - ) |
|
| 235 | - . "<br>\n"; |
|
| 236 | - break; |
|
| 237 | - case 'echo': |
|
| 238 | - default: |
|
| 239 | - //Normalize line breaks |
|
| 240 | - $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str); |
|
| 241 | - echo gmdate('Y-m-d H:i:s') . "\t" . str_replace( |
|
| 242 | - "\n", |
|
| 243 | - "\n \t ", |
|
| 244 | - trim($str) |
|
| 245 | - )."\n"; |
|
| 224 | + case 'error_log': |
|
| 225 | + //Don't output, just log |
|
| 226 | + error_log($str); |
|
| 227 | + break; |
|
| 228 | + case 'html': |
|
| 229 | + //Cleans up output a bit for a better looking, HTML-safe output |
|
| 230 | + echo htmlentities( |
|
| 231 | + preg_replace('/[\r\n]+/', '', $str), |
|
| 232 | + ENT_QUOTES, |
|
| 233 | + 'UTF-8' |
|
| 234 | + ) |
|
| 235 | + . "<br>\n"; |
|
| 236 | + break; |
|
| 237 | + case 'echo': |
|
| 238 | + default: |
|
| 239 | + //Normalize line breaks |
|
| 240 | + $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str); |
|
| 241 | + echo gmdate('Y-m-d H:i:s') . "\t" . str_replace( |
|
| 242 | + "\n", |
|
| 243 | + "\n \t ", |
|
| 244 | + trim($str) |
|
| 245 | + )."\n"; |
|
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | 248 | |
@@ -435,48 +435,48 @@ discard block |
||
| 435 | 435 | $authtype = 'LOGIN'; |
| 436 | 436 | } |
| 437 | 437 | switch ($authtype) { |
| 438 | - case 'PLAIN': |
|
| 439 | - // Start authentication |
|
| 440 | - if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) { |
|
| 441 | - return false; |
|
| 442 | - } |
|
| 443 | - // Send encoded username and password |
|
| 444 | - if (!$this->sendCommand( |
|
| 445 | - 'User & Password', |
|
| 446 | - base64_encode("\0" . $username . "\0" . $password), |
|
| 447 | - 235 |
|
| 448 | - ) |
|
| 449 | - ) { |
|
| 450 | - return false; |
|
| 451 | - } |
|
| 452 | - break; |
|
| 453 | - case 'LOGIN': |
|
| 454 | - // Start authentication |
|
| 455 | - if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) { |
|
| 456 | - return false; |
|
| 457 | - } |
|
| 458 | - if (!$this->sendCommand("Username", base64_encode($username), 334)) { |
|
| 459 | - return false; |
|
| 460 | - } |
|
| 461 | - if (!$this->sendCommand("Password", base64_encode($password), 235)) { |
|
| 462 | - return false; |
|
| 463 | - } |
|
| 464 | - break; |
|
| 465 | - case 'XOAUTH2': |
|
| 466 | - //If the OAuth Instance is not set. Can be a case when PHPMailer is used |
|
| 467 | - //instead of PHPMailerOAuth |
|
| 468 | - if (is_null($OAuth)) { |
|
| 469 | - return false; |
|
| 470 | - } |
|
| 471 | - $oauth = $OAuth->getOauth64(); |
|
| 438 | + case 'PLAIN': |
|
| 439 | + // Start authentication |
|
| 440 | + if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) { |
|
| 441 | + return false; |
|
| 442 | + } |
|
| 443 | + // Send encoded username and password |
|
| 444 | + if (!$this->sendCommand( |
|
| 445 | + 'User & Password', |
|
| 446 | + base64_encode("\0" . $username . "\0" . $password), |
|
| 447 | + 235 |
|
| 448 | + ) |
|
| 449 | + ) { |
|
| 450 | + return false; |
|
| 451 | + } |
|
| 452 | + break; |
|
| 453 | + case 'LOGIN': |
|
| 454 | + // Start authentication |
|
| 455 | + if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) { |
|
| 456 | + return false; |
|
| 457 | + } |
|
| 458 | + if (!$this->sendCommand("Username", base64_encode($username), 334)) { |
|
| 459 | + return false; |
|
| 460 | + } |
|
| 461 | + if (!$this->sendCommand("Password", base64_encode($password), 235)) { |
|
| 462 | + return false; |
|
| 463 | + } |
|
| 464 | + break; |
|
| 465 | + case 'XOAUTH2': |
|
| 466 | + //If the OAuth Instance is not set. Can be a case when PHPMailer is used |
|
| 467 | + //instead of PHPMailerOAuth |
|
| 468 | + if (is_null($OAuth)) { |
|
| 469 | + return false; |
|
| 470 | + } |
|
| 471 | + $oauth = $OAuth->getOauth64(); |
|
| 472 | 472 | |
| 473 | - // Start authentication |
|
| 474 | - if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) { |
|
| 475 | - return false; |
|
| 476 | - } |
|
| 477 | - break; |
|
| 478 | - case 'NTLM': |
|
| 479 | - /* |
|
| 473 | + // Start authentication |
|
| 474 | + if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) { |
|
| 475 | + return false; |
|
| 476 | + } |
|
| 477 | + break; |
|
| 478 | + case 'NTLM': |
|
| 479 | + /* |
|
| 480 | 480 | * ntlm_sasl_client.php |
| 481 | 481 | * Bundled with Permission |
| 482 | 482 | * |
@@ -484,63 +484,63 @@ discard block |
||
| 484 | 484 | * http://technet.microsoft.com/en-us/library/aa995718%28EXCHG.65%29.aspx |
| 485 | 485 | * PROTOCOL Docs http://curl.haxx.se/rfc/ntlm.html#ntlmSmtpAuthentication |
| 486 | 486 | */ |
| 487 | - require_once 'extras/ntlm_sasl_client.php'; |
|
| 488 | - $temp = new stdClass; |
|
| 489 | - $ntlm_client = new ntlm_sasl_client_class; |
|
| 490 | - //Check that functions are available |
|
| 491 | - if (!$ntlm_client->initialize($temp)) { |
|
| 492 | - $this->setError($temp->error); |
|
| 493 | - $this->edebug( |
|
| 494 | - 'You need to enable some modules in your php.ini file: ' |
|
| 495 | - . $this->error['error'], |
|
| 496 | - self::DEBUG_CLIENT |
|
| 497 | - ); |
|
| 498 | - return false; |
|
| 499 | - } |
|
| 500 | - //msg1 |
|
| 501 | - $msg1 = $ntlm_client->typeMsg1($realm, $workstation); //msg1 |
|
| 502 | - |
|
| 503 | - if (!$this->sendCommand( |
|
| 504 | - 'AUTH NTLM', |
|
| 505 | - 'AUTH NTLM ' . base64_encode($msg1), |
|
| 506 | - 334 |
|
| 507 | - ) |
|
| 508 | - ) { |
|
| 509 | - return false; |
|
| 510 | - } |
|
| 511 | - //Though 0 based, there is a white space after the 3 digit number |
|
| 512 | - //msg2 |
|
| 513 | - $challenge = substr($this->last_reply, 3); |
|
| 514 | - $challenge = base64_decode($challenge); |
|
| 515 | - $ntlm_res = $ntlm_client->NTLMResponse( |
|
| 516 | - substr($challenge, 24, 8), |
|
| 517 | - $password |
|
| 518 | - ); |
|
| 519 | - //msg3 |
|
| 520 | - $msg3 = $ntlm_client->typeMsg3( |
|
| 521 | - $ntlm_res, |
|
| 522 | - $username, |
|
| 523 | - $realm, |
|
| 524 | - $workstation |
|
| 487 | + require_once 'extras/ntlm_sasl_client.php'; |
|
| 488 | + $temp = new stdClass; |
|
| 489 | + $ntlm_client = new ntlm_sasl_client_class; |
|
| 490 | + //Check that functions are available |
|
| 491 | + if (!$ntlm_client->initialize($temp)) { |
|
| 492 | + $this->setError($temp->error); |
|
| 493 | + $this->edebug( |
|
| 494 | + 'You need to enable some modules in your php.ini file: ' |
|
| 495 | + . $this->error['error'], |
|
| 496 | + self::DEBUG_CLIENT |
|
| 525 | 497 | ); |
| 526 | - // send encoded username |
|
| 527 | - return $this->sendCommand('Username', base64_encode($msg3), 235); |
|
| 528 | - case 'CRAM-MD5': |
|
| 529 | - // Start authentication |
|
| 530 | - if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) { |
|
| 531 | - return false; |
|
| 532 | - } |
|
| 533 | - // Get the challenge |
|
| 534 | - $challenge = base64_decode(substr($this->last_reply, 4)); |
|
| 498 | + return false; |
|
| 499 | + } |
|
| 500 | + //msg1 |
|
| 501 | + $msg1 = $ntlm_client->typeMsg1($realm, $workstation); //msg1 |
|
| 502 | + |
|
| 503 | + if (!$this->sendCommand( |
|
| 504 | + 'AUTH NTLM', |
|
| 505 | + 'AUTH NTLM ' . base64_encode($msg1), |
|
| 506 | + 334 |
|
| 507 | + ) |
|
| 508 | + ) { |
|
| 509 | + return false; |
|
| 510 | + } |
|
| 511 | + //Though 0 based, there is a white space after the 3 digit number |
|
| 512 | + //msg2 |
|
| 513 | + $challenge = substr($this->last_reply, 3); |
|
| 514 | + $challenge = base64_decode($challenge); |
|
| 515 | + $ntlm_res = $ntlm_client->NTLMResponse( |
|
| 516 | + substr($challenge, 24, 8), |
|
| 517 | + $password |
|
| 518 | + ); |
|
| 519 | + //msg3 |
|
| 520 | + $msg3 = $ntlm_client->typeMsg3( |
|
| 521 | + $ntlm_res, |
|
| 522 | + $username, |
|
| 523 | + $realm, |
|
| 524 | + $workstation |
|
| 525 | + ); |
|
| 526 | + // send encoded username |
|
| 527 | + return $this->sendCommand('Username', base64_encode($msg3), 235); |
|
| 528 | + case 'CRAM-MD5': |
|
| 529 | + // Start authentication |
|
| 530 | + if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) { |
|
| 531 | + return false; |
|
| 532 | + } |
|
| 533 | + // Get the challenge |
|
| 534 | + $challenge = base64_decode(substr($this->last_reply, 4)); |
|
| 535 | 535 | |
| 536 | - // Build the response |
|
| 537 | - $response = $username . ' ' . $this->hmac($challenge, $password); |
|
| 536 | + // Build the response |
|
| 537 | + $response = $username . ' ' . $this->hmac($challenge, $password); |
|
| 538 | 538 | |
| 539 | - // send encoded credentials |
|
| 540 | - return $this->sendCommand('Username', base64_encode($response), 235); |
|
| 541 | - default: |
|
| 542 | - $this->setError("Authentication method \"$authtype\" is not supported"); |
|
| 543 | - return false; |
|
| 539 | + // send encoded credentials |
|
| 540 | + return $this->sendCommand('Username', base64_encode($response), 235); |
|
| 541 | + default: |
|
| 542 | + $this->setError("Authentication method \"$authtype\" is not supported"); |
|
| 543 | + return false; |
|
| 544 | 544 | } |
| 545 | 545 | return true; |
| 546 | 546 | } |
@@ -777,16 +777,16 @@ discard block |
||
| 777 | 777 | } else { |
| 778 | 778 | $name = array_shift($fields); |
| 779 | 779 | switch ($name) { |
| 780 | - case 'SIZE': |
|
| 781 | - $fields = ($fields ? $fields[0] : 0); |
|
| 782 | - break; |
|
| 783 | - case 'AUTH': |
|
| 784 | - if (!is_array($fields)) { |
|
| 785 | - $fields = array(); |
|
| 786 | - } |
|
| 787 | - break; |
|
| 788 | - default: |
|
| 789 | - $fields = true; |
|
| 780 | + case 'SIZE': |
|
| 781 | + $fields = ($fields ? $fields[0] : 0); |
|
| 782 | + break; |
|
| 783 | + case 'AUTH': |
|
| 784 | + if (!is_array($fields)) { |
|
| 785 | + $fields = array(); |
|
| 786 | + } |
|
| 787 | + break; |
|
| 788 | + default: |
|
| 789 | + $fields = true; |
|
| 790 | 790 | } |
| 791 | 791 | } |
| 792 | 792 | $this->server_caps[$name] = $fields; |
@@ -719,28 +719,28 @@ discard block |
||
| 719 | 719 | return; |
| 720 | 720 | } |
| 721 | 721 | switch ($this->Debugoutput) { |
| 722 | - case 'error_log': |
|
| 723 | - //Don't output, just log |
|
| 724 | - error_log($str); |
|
| 725 | - break; |
|
| 726 | - case 'html': |
|
| 727 | - //Cleans up output a bit for a better looking, HTML-safe output |
|
| 728 | - echo htmlentities( |
|
| 729 | - preg_replace('/[\r\n]+/', '', $str), |
|
| 730 | - ENT_QUOTES, |
|
| 731 | - 'UTF-8' |
|
| 732 | - ) |
|
| 733 | - . "<br>\n"; |
|
| 734 | - break; |
|
| 735 | - case 'echo': |
|
| 736 | - default: |
|
| 737 | - //Normalize line breaks |
|
| 738 | - $str = preg_replace('/\r\n?/ms', "\n", $str); |
|
| 739 | - echo gmdate('Y-m-d H:i:s') . "\t" . str_replace( |
|
| 740 | - "\n", |
|
| 741 | - "\n \t ", |
|
| 742 | - trim($str) |
|
| 743 | - ) . "\n"; |
|
| 722 | + case 'error_log': |
|
| 723 | + //Don't output, just log |
|
| 724 | + error_log($str); |
|
| 725 | + break; |
|
| 726 | + case 'html': |
|
| 727 | + //Cleans up output a bit for a better looking, HTML-safe output |
|
| 728 | + echo htmlentities( |
|
| 729 | + preg_replace('/[\r\n]+/', '', $str), |
|
| 730 | + ENT_QUOTES, |
|
| 731 | + 'UTF-8' |
|
| 732 | + ) |
|
| 733 | + . "<br>\n"; |
|
| 734 | + break; |
|
| 735 | + case 'echo': |
|
| 736 | + default: |
|
| 737 | + //Normalize line breaks |
|
| 738 | + $str = preg_replace('/\r\n?/ms', "\n", $str); |
|
| 739 | + echo gmdate('Y-m-d H:i:s') . "\t" . str_replace( |
|
| 740 | + "\n", |
|
| 741 | + "\n \t ", |
|
| 742 | + trim($str) |
|
| 743 | + ) . "\n"; |
|
| 744 | 744 | } |
| 745 | 745 | } |
| 746 | 746 | |
@@ -1100,59 +1100,59 @@ discard block |
||
| 1100 | 1100 | } |
| 1101 | 1101 | } |
| 1102 | 1102 | switch ($patternselect) { |
| 1103 | - case 'pcre8': |
|
| 1104 | - /** |
|
| 1103 | + case 'pcre8': |
|
| 1104 | + /** |
|
| 1105 | 1105 | * Uses the same RFC5322 regex on which FILTER_VALIDATE_EMAIL is based, but allows dotless domains. |
| 1106 | 1106 | * @link http://squiloople.com/2009/12/20/email-address-validation/ |
| 1107 | 1107 | * @copyright 2009-2010 Michael Rushton |
| 1108 | 1108 | * Feel free to use and redistribute this code. But please keep this copyright notice. |
| 1109 | 1109 | */ |
| 1110 | - return (boolean)preg_match( |
|
| 1111 | - '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' . |
|
| 1112 | - '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' . |
|
| 1113 | - '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' . |
|
| 1114 | - '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' . |
|
| 1115 | - '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' . |
|
| 1116 | - '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' . |
|
| 1117 | - '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' . |
|
| 1118 | - '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' . |
|
| 1119 | - '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', |
|
| 1120 | - $address |
|
| 1121 | - ); |
|
| 1122 | - case 'pcre': |
|
| 1123 | - //An older regex that doesn't need a recent PCRE |
|
| 1124 | - return (boolean)preg_match( |
|
| 1125 | - '/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!(?>"?(?>\\\[ -~]|[^"])"?){65,}@)(?>' . |
|
| 1126 | - '[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*")' . |
|
| 1127 | - '(?>\.(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*"))*' . |
|
| 1128 | - '@(?>(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?![a-z0-9-]{64,})' . |
|
| 1129 | - '(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)){0,126}|\[(?:(?>IPv6:(?>(?>[a-f0-9]{1,4})(?>:' . |
|
| 1130 | - '[a-f0-9]{1,4}){7}|(?!(?:.*[a-f0-9][:\]]){8,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?' . |
|
| 1131 | - '::(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?))|(?>(?>IPv6:(?>[a-f0-9]{1,4}(?>:' . |
|
| 1132 | - '[a-f0-9]{1,4}){5}:|(?!(?:.*[a-f0-9]:){6,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4})?' . |
|
| 1133 | - '::(?>(?:[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4}):)?))?(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}' . |
|
| 1134 | - '|[1-9]?[0-9])(?>\.(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}))\])$/isD', |
|
| 1135 | - $address |
|
| 1136 | - ); |
|
| 1137 | - case 'html5': |
|
| 1138 | - /** |
|
| 1110 | + return (boolean)preg_match( |
|
| 1111 | + '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' . |
|
| 1112 | + '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' . |
|
| 1113 | + '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' . |
|
| 1114 | + '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' . |
|
| 1115 | + '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' . |
|
| 1116 | + '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' . |
|
| 1117 | + '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' . |
|
| 1118 | + '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' . |
|
| 1119 | + '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', |
|
| 1120 | + $address |
|
| 1121 | + ); |
|
| 1122 | + case 'pcre': |
|
| 1123 | + //An older regex that doesn't need a recent PCRE |
|
| 1124 | + return (boolean)preg_match( |
|
| 1125 | + '/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!(?>"?(?>\\\[ -~]|[^"])"?){65,}@)(?>' . |
|
| 1126 | + '[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*")' . |
|
| 1127 | + '(?>\.(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*"))*' . |
|
| 1128 | + '@(?>(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?![a-z0-9-]{64,})' . |
|
| 1129 | + '(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)){0,126}|\[(?:(?>IPv6:(?>(?>[a-f0-9]{1,4})(?>:' . |
|
| 1130 | + '[a-f0-9]{1,4}){7}|(?!(?:.*[a-f0-9][:\]]){8,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?' . |
|
| 1131 | + '::(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?))|(?>(?>IPv6:(?>[a-f0-9]{1,4}(?>:' . |
|
| 1132 | + '[a-f0-9]{1,4}){5}:|(?!(?:.*[a-f0-9]:){6,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4})?' . |
|
| 1133 | + '::(?>(?:[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4}):)?))?(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}' . |
|
| 1134 | + '|[1-9]?[0-9])(?>\.(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}))\])$/isD', |
|
| 1135 | + $address |
|
| 1136 | + ); |
|
| 1137 | + case 'html5': |
|
| 1138 | + /** |
|
| 1139 | 1139 | * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements. |
| 1140 | 1140 | * @link http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email) |
| 1141 | 1141 | */ |
| 1142 | - return (boolean)preg_match( |
|
| 1143 | - '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . |
|
| 1144 | - '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD', |
|
| 1145 | - $address |
|
| 1146 | - ); |
|
| 1147 | - case 'noregex': |
|
| 1148 | - //No PCRE! Do something _very_ approximate! |
|
| 1149 | - //Check the address is 3 chars or longer and contains an @ that's not the first or last char |
|
| 1150 | - return (strlen($address) >= 3 |
|
| 1151 | - and strpos($address, '@') >= 1 |
|
| 1152 | - and strpos($address, '@') != strlen($address) - 1); |
|
| 1153 | - case 'php': |
|
| 1154 | - default: |
|
| 1155 | - return (boolean)filter_var($address, FILTER_VALIDATE_EMAIL); |
|
| 1142 | + return (boolean)preg_match( |
|
| 1143 | + '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . |
|
| 1144 | + '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD', |
|
| 1145 | + $address |
|
| 1146 | + ); |
|
| 1147 | + case 'noregex': |
|
| 1148 | + //No PCRE! Do something _very_ approximate! |
|
| 1149 | + //Check the address is 3 chars or longer and contains an @ that's not the first or last char |
|
| 1150 | + return (strlen($address) >= 3 |
|
| 1151 | + and strpos($address, '@') >= 1 |
|
| 1152 | + and strpos($address, '@') != strlen($address) - 1); |
|
| 1153 | + case 'php': |
|
| 1154 | + default: |
|
| 1155 | + return (boolean)filter_var($address, FILTER_VALIDATE_EMAIL); |
|
| 1156 | 1156 | } |
| 1157 | 1157 | } |
| 1158 | 1158 | |
@@ -1328,20 +1328,20 @@ discard block |
||
| 1328 | 1328 | try { |
| 1329 | 1329 | // Choose the mailer and send through it |
| 1330 | 1330 | switch ($this->Mailer) { |
| 1331 | - case 'sendmail': |
|
| 1332 | - case 'qmail': |
|
| 1333 | - return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody); |
|
| 1334 | - case 'smtp': |
|
| 1335 | - return $this->smtpSend($this->MIMEHeader, $this->MIMEBody); |
|
| 1336 | - case 'mail': |
|
| 1337 | - return $this->mailSend($this->MIMEHeader, $this->MIMEBody); |
|
| 1338 | - default: |
|
| 1339 | - $sendMethod = $this->Mailer.'Send'; |
|
| 1340 | - if (method_exists($this, $sendMethod)) { |
|
| 1341 | - return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody); |
|
| 1342 | - } |
|
| 1331 | + case 'sendmail': |
|
| 1332 | + case 'qmail': |
|
| 1333 | + return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody); |
|
| 1334 | + case 'smtp': |
|
| 1335 | + return $this->smtpSend($this->MIMEHeader, $this->MIMEBody); |
|
| 1336 | + case 'mail': |
|
| 1337 | + return $this->mailSend($this->MIMEHeader, $this->MIMEBody); |
|
| 1338 | + default: |
|
| 1339 | + $sendMethod = $this->Mailer.'Send'; |
|
| 1340 | + if (method_exists($this, $sendMethod)) { |
|
| 1341 | + return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody); |
|
| 1342 | + } |
|
| 1343 | 1343 | |
| 1344 | - return $this->mailSend($this->MIMEHeader, $this->MIMEBody); |
|
| 1344 | + return $this->mailSend($this->MIMEHeader, $this->MIMEBody); |
|
| 1345 | 1345 | } |
| 1346 | 1346 | } catch (phpmailerException $exc) { |
| 1347 | 1347 | $this->setError($exc->getMessage()); |
@@ -2003,15 +2003,15 @@ discard block |
||
| 2003 | 2003 | } |
| 2004 | 2004 | |
| 2005 | 2005 | switch ($this->message_type) { |
| 2006 | - case 'alt': |
|
| 2007 | - case 'alt_inline': |
|
| 2008 | - case 'alt_attach': |
|
| 2009 | - case 'alt_inline_attach': |
|
| 2010 | - $this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap); |
|
| 2011 | - break; |
|
| 2012 | - default: |
|
| 2013 | - $this->Body = $this->wrapText($this->Body, $this->WordWrap); |
|
| 2014 | - break; |
|
| 2006 | + case 'alt': |
|
| 2007 | + case 'alt_inline': |
|
| 2008 | + case 'alt_attach': |
|
| 2009 | + case 'alt_inline_attach': |
|
| 2010 | + $this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap); |
|
| 2011 | + break; |
|
| 2012 | + default: |
|
| 2013 | + $this->Body = $this->wrapText($this->Body, $this->WordWrap); |
|
| 2014 | + break; |
|
| 2015 | 2015 | } |
| 2016 | 2016 | } |
| 2017 | 2017 | |
@@ -2123,27 +2123,27 @@ discard block |
||
| 2123 | 2123 | $result = ''; |
| 2124 | 2124 | $ismultipart = true; |
| 2125 | 2125 | switch ($this->message_type) { |
| 2126 | - case 'inline': |
|
| 2127 | - $result .= $this->headerLine('Content-Type', 'multipart/related;'); |
|
| 2128 | - $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); |
|
| 2129 | - break; |
|
| 2130 | - case 'attach': |
|
| 2131 | - case 'inline_attach': |
|
| 2132 | - case 'alt_attach': |
|
| 2133 | - case 'alt_inline_attach': |
|
| 2134 | - $result .= $this->headerLine('Content-Type', 'multipart/mixed;'); |
|
| 2135 | - $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); |
|
| 2136 | - break; |
|
| 2137 | - case 'alt': |
|
| 2138 | - case 'alt_inline': |
|
| 2139 | - $result .= $this->headerLine('Content-Type', 'multipart/alternative;'); |
|
| 2140 | - $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); |
|
| 2141 | - break; |
|
| 2142 | - default: |
|
| 2143 | - // Catches case 'plain': and case '': |
|
| 2144 | - $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet); |
|
| 2145 | - $ismultipart = false; |
|
| 2146 | - break; |
|
| 2126 | + case 'inline': |
|
| 2127 | + $result .= $this->headerLine('Content-Type', 'multipart/related;'); |
|
| 2128 | + $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); |
|
| 2129 | + break; |
|
| 2130 | + case 'attach': |
|
| 2131 | + case 'inline_attach': |
|
| 2132 | + case 'alt_attach': |
|
| 2133 | + case 'alt_inline_attach': |
|
| 2134 | + $result .= $this->headerLine('Content-Type', 'multipart/mixed;'); |
|
| 2135 | + $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); |
|
| 2136 | + break; |
|
| 2137 | + case 'alt': |
|
| 2138 | + case 'alt_inline': |
|
| 2139 | + $result .= $this->headerLine('Content-Type', 'multipart/alternative;'); |
|
| 2140 | + $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); |
|
| 2141 | + break; |
|
| 2142 | + default: |
|
| 2143 | + // Catches case 'plain': and case '': |
|
| 2144 | + $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet); |
|
| 2145 | + $ismultipart = false; |
|
| 2146 | + break; |
|
| 2147 | 2147 | } |
| 2148 | 2148 | // RFC1341 part 5 says 7bit is assumed if not specified |
| 2149 | 2149 | if ($this->Encoding != '7bit') { |
@@ -2238,108 +2238,108 @@ discard block |
||
| 2238 | 2238 | //Use this as a preamble in all multipart message types |
| 2239 | 2239 | $mimepre = "This is a multi-part message in MIME format." . $this->LE . $this->LE; |
| 2240 | 2240 | switch ($this->message_type) { |
| 2241 | - case 'inline': |
|
| 2242 | - $body .= $mimepre; |
|
| 2243 | - $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); |
|
| 2244 | - $body .= $this->encodeString($this->Body, $bodyEncoding); |
|
| 2245 | - $body .= $this->LE . $this->LE; |
|
| 2246 | - $body .= $this->attachAll('inline', $this->boundary[1]); |
|
| 2247 | - break; |
|
| 2248 | - case 'attach': |
|
| 2249 | - $body .= $mimepre; |
|
| 2250 | - $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); |
|
| 2251 | - $body .= $this->encodeString($this->Body, $bodyEncoding); |
|
| 2252 | - $body .= $this->LE . $this->LE; |
|
| 2253 | - $body .= $this->attachAll('attachment', $this->boundary[1]); |
|
| 2254 | - break; |
|
| 2255 | - case 'inline_attach': |
|
| 2256 | - $body .= $mimepre; |
|
| 2257 | - $body .= $this->textLine('--' . $this->boundary[1]); |
|
| 2258 | - $body .= $this->headerLine('Content-Type', 'multipart/related;'); |
|
| 2259 | - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); |
|
| 2260 | - $body .= $this->LE; |
|
| 2261 | - $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding); |
|
| 2262 | - $body .= $this->encodeString($this->Body, $bodyEncoding); |
|
| 2263 | - $body .= $this->LE . $this->LE; |
|
| 2264 | - $body .= $this->attachAll('inline', $this->boundary[2]); |
|
| 2265 | - $body .= $this->LE; |
|
| 2266 | - $body .= $this->attachAll('attachment', $this->boundary[1]); |
|
| 2267 | - break; |
|
| 2268 | - case 'alt': |
|
| 2269 | - $body .= $mimepre; |
|
| 2270 | - $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); |
|
| 2271 | - $body .= $this->encodeString($this->AltBody, $altBodyEncoding); |
|
| 2272 | - $body .= $this->LE . $this->LE; |
|
| 2273 | - $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, 'text/html', $bodyEncoding); |
|
| 2274 | - $body .= $this->encodeString($this->Body, $bodyEncoding); |
|
| 2241 | + case 'inline': |
|
| 2242 | + $body .= $mimepre; |
|
| 2243 | + $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); |
|
| 2244 | + $body .= $this->encodeString($this->Body, $bodyEncoding); |
|
| 2245 | + $body .= $this->LE . $this->LE; |
|
| 2246 | + $body .= $this->attachAll('inline', $this->boundary[1]); |
|
| 2247 | + break; |
|
| 2248 | + case 'attach': |
|
| 2249 | + $body .= $mimepre; |
|
| 2250 | + $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); |
|
| 2251 | + $body .= $this->encodeString($this->Body, $bodyEncoding); |
|
| 2252 | + $body .= $this->LE . $this->LE; |
|
| 2253 | + $body .= $this->attachAll('attachment', $this->boundary[1]); |
|
| 2254 | + break; |
|
| 2255 | + case 'inline_attach': |
|
| 2256 | + $body .= $mimepre; |
|
| 2257 | + $body .= $this->textLine('--' . $this->boundary[1]); |
|
| 2258 | + $body .= $this->headerLine('Content-Type', 'multipart/related;'); |
|
| 2259 | + $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); |
|
| 2260 | + $body .= $this->LE; |
|
| 2261 | + $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding); |
|
| 2262 | + $body .= $this->encodeString($this->Body, $bodyEncoding); |
|
| 2263 | + $body .= $this->LE . $this->LE; |
|
| 2264 | + $body .= $this->attachAll('inline', $this->boundary[2]); |
|
| 2265 | + $body .= $this->LE; |
|
| 2266 | + $body .= $this->attachAll('attachment', $this->boundary[1]); |
|
| 2267 | + break; |
|
| 2268 | + case 'alt': |
|
| 2269 | + $body .= $mimepre; |
|
| 2270 | + $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); |
|
| 2271 | + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); |
|
| 2272 | + $body .= $this->LE . $this->LE; |
|
| 2273 | + $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, 'text/html', $bodyEncoding); |
|
| 2274 | + $body .= $this->encodeString($this->Body, $bodyEncoding); |
|
| 2275 | + $body .= $this->LE . $this->LE; |
|
| 2276 | + if (!empty($this->Ical)) { |
|
| 2277 | + $body .= $this->getBoundary($this->boundary[1], '', 'text/calendar; method=REQUEST', ''); |
|
| 2278 | + $body .= $this->encodeString($this->Ical, $this->Encoding); |
|
| 2275 | 2279 | $body .= $this->LE . $this->LE; |
| 2276 | - if (!empty($this->Ical)) { |
|
| 2277 | - $body .= $this->getBoundary($this->boundary[1], '', 'text/calendar; method=REQUEST', ''); |
|
| 2278 | - $body .= $this->encodeString($this->Ical, $this->Encoding); |
|
| 2279 | - $body .= $this->LE . $this->LE; |
|
| 2280 | - } |
|
| 2281 | - $body .= $this->endBoundary($this->boundary[1]); |
|
| 2282 | - break; |
|
| 2283 | - case 'alt_inline': |
|
| 2284 | - $body .= $mimepre; |
|
| 2285 | - $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); |
|
| 2286 | - $body .= $this->encodeString($this->AltBody, $altBodyEncoding); |
|
| 2287 | - $body .= $this->LE . $this->LE; |
|
| 2288 | - $body .= $this->textLine('--' . $this->boundary[1]); |
|
| 2289 | - $body .= $this->headerLine('Content-Type', 'multipart/related;'); |
|
| 2290 | - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); |
|
| 2291 | - $body .= $this->LE; |
|
| 2292 | - $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); |
|
| 2293 | - $body .= $this->encodeString($this->Body, $bodyEncoding); |
|
| 2294 | - $body .= $this->LE . $this->LE; |
|
| 2295 | - $body .= $this->attachAll('inline', $this->boundary[2]); |
|
| 2296 | - $body .= $this->LE; |
|
| 2297 | - $body .= $this->endBoundary($this->boundary[1]); |
|
| 2298 | - break; |
|
| 2299 | - case 'alt_attach': |
|
| 2300 | - $body .= $mimepre; |
|
| 2301 | - $body .= $this->textLine('--' . $this->boundary[1]); |
|
| 2302 | - $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); |
|
| 2303 | - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); |
|
| 2304 | - $body .= $this->LE; |
|
| 2305 | - $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); |
|
| 2306 | - $body .= $this->encodeString($this->AltBody, $altBodyEncoding); |
|
| 2307 | - $body .= $this->LE . $this->LE; |
|
| 2308 | - $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); |
|
| 2309 | - $body .= $this->encodeString($this->Body, $bodyEncoding); |
|
| 2310 | - $body .= $this->LE . $this->LE; |
|
| 2311 | - $body .= $this->endBoundary($this->boundary[2]); |
|
| 2312 | - $body .= $this->LE; |
|
| 2313 | - $body .= $this->attachAll('attachment', $this->boundary[1]); |
|
| 2314 | - break; |
|
| 2315 | - case 'alt_inline_attach': |
|
| 2316 | - $body .= $mimepre; |
|
| 2317 | - $body .= $this->textLine('--' . $this->boundary[1]); |
|
| 2318 | - $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); |
|
| 2319 | - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); |
|
| 2320 | - $body .= $this->LE; |
|
| 2321 | - $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); |
|
| 2322 | - $body .= $this->encodeString($this->AltBody, $altBodyEncoding); |
|
| 2323 | - $body .= $this->LE . $this->LE; |
|
| 2324 | - $body .= $this->textLine('--' . $this->boundary[2]); |
|
| 2325 | - $body .= $this->headerLine('Content-Type', 'multipart/related;'); |
|
| 2326 | - $body .= $this->textLine("\tboundary=\"" . $this->boundary[3] . '"'); |
|
| 2327 | - $body .= $this->LE; |
|
| 2328 | - $body .= $this->getBoundary($this->boundary[3], $bodyCharSet, 'text/html', $bodyEncoding); |
|
| 2329 | - $body .= $this->encodeString($this->Body, $bodyEncoding); |
|
| 2330 | - $body .= $this->LE . $this->LE; |
|
| 2331 | - $body .= $this->attachAll('inline', $this->boundary[3]); |
|
| 2332 | - $body .= $this->LE; |
|
| 2333 | - $body .= $this->endBoundary($this->boundary[2]); |
|
| 2334 | - $body .= $this->LE; |
|
| 2335 | - $body .= $this->attachAll('attachment', $this->boundary[1]); |
|
| 2336 | - break; |
|
| 2337 | - default: |
|
| 2338 | - // Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types |
|
| 2339 | - //Reset the `Encoding` property in case we changed it for line length reasons |
|
| 2340 | - $this->Encoding = $bodyEncoding; |
|
| 2341 | - $body .= $this->encodeString($this->Body, $this->Encoding); |
|
| 2342 | - break; |
|
| 2280 | + } |
|
| 2281 | + $body .= $this->endBoundary($this->boundary[1]); |
|
| 2282 | + break; |
|
| 2283 | + case 'alt_inline': |
|
| 2284 | + $body .= $mimepre; |
|
| 2285 | + $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); |
|
| 2286 | + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); |
|
| 2287 | + $body .= $this->LE . $this->LE; |
|
| 2288 | + $body .= $this->textLine('--' . $this->boundary[1]); |
|
| 2289 | + $body .= $this->headerLine('Content-Type', 'multipart/related;'); |
|
| 2290 | + $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); |
|
| 2291 | + $body .= $this->LE; |
|
| 2292 | + $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); |
|
| 2293 | + $body .= $this->encodeString($this->Body, $bodyEncoding); |
|
| 2294 | + $body .= $this->LE . $this->LE; |
|
| 2295 | + $body .= $this->attachAll('inline', $this->boundary[2]); |
|
| 2296 | + $body .= $this->LE; |
|
| 2297 | + $body .= $this->endBoundary($this->boundary[1]); |
|
| 2298 | + break; |
|
| 2299 | + case 'alt_attach': |
|
| 2300 | + $body .= $mimepre; |
|
| 2301 | + $body .= $this->textLine('--' . $this->boundary[1]); |
|
| 2302 | + $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); |
|
| 2303 | + $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); |
|
| 2304 | + $body .= $this->LE; |
|
| 2305 | + $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); |
|
| 2306 | + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); |
|
| 2307 | + $body .= $this->LE . $this->LE; |
|
| 2308 | + $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); |
|
| 2309 | + $body .= $this->encodeString($this->Body, $bodyEncoding); |
|
| 2310 | + $body .= $this->LE . $this->LE; |
|
| 2311 | + $body .= $this->endBoundary($this->boundary[2]); |
|
| 2312 | + $body .= $this->LE; |
|
| 2313 | + $body .= $this->attachAll('attachment', $this->boundary[1]); |
|
| 2314 | + break; |
|
| 2315 | + case 'alt_inline_attach': |
|
| 2316 | + $body .= $mimepre; |
|
| 2317 | + $body .= $this->textLine('--' . $this->boundary[1]); |
|
| 2318 | + $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); |
|
| 2319 | + $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); |
|
| 2320 | + $body .= $this->LE; |
|
| 2321 | + $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); |
|
| 2322 | + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); |
|
| 2323 | + $body .= $this->LE . $this->LE; |
|
| 2324 | + $body .= $this->textLine('--' . $this->boundary[2]); |
|
| 2325 | + $body .= $this->headerLine('Content-Type', 'multipart/related;'); |
|
| 2326 | + $body .= $this->textLine("\tboundary=\"" . $this->boundary[3] . '"'); |
|
| 2327 | + $body .= $this->LE; |
|
| 2328 | + $body .= $this->getBoundary($this->boundary[3], $bodyCharSet, 'text/html', $bodyEncoding); |
|
| 2329 | + $body .= $this->encodeString($this->Body, $bodyEncoding); |
|
| 2330 | + $body .= $this->LE . $this->LE; |
|
| 2331 | + $body .= $this->attachAll('inline', $this->boundary[3]); |
|
| 2332 | + $body .= $this->LE; |
|
| 2333 | + $body .= $this->endBoundary($this->boundary[2]); |
|
| 2334 | + $body .= $this->LE; |
|
| 2335 | + $body .= $this->attachAll('attachment', $this->boundary[1]); |
|
| 2336 | + break; |
|
| 2337 | + default: |
|
| 2338 | + // Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types |
|
| 2339 | + //Reset the `Encoding` property in case we changed it for line length reasons |
|
| 2340 | + $this->Encoding = $bodyEncoding; |
|
| 2341 | + $body .= $this->encodeString($this->Body, $this->Encoding); |
|
| 2342 | + break; |
|
| 2343 | 2343 | } |
| 2344 | 2344 | |
| 2345 | 2345 | if ($this->isError()) { |
@@ -2727,26 +2727,26 @@ discard block |
||
| 2727 | 2727 | { |
| 2728 | 2728 | $encoded = ''; |
| 2729 | 2729 | switch (strtolower($encoding)) { |
| 2730 | - case 'base64': |
|
| 2731 | - $encoded = chunk_split(base64_encode($str), 76, $this->LE); |
|
| 2732 | - break; |
|
| 2733 | - case '7bit': |
|
| 2734 | - case '8bit': |
|
| 2735 | - $encoded = $this->fixEOL($str); |
|
| 2736 | - // Make sure it ends with a line break |
|
| 2737 | - if (substr($encoded, -(strlen($this->LE))) != $this->LE) { |
|
| 2738 | - $encoded .= $this->LE; |
|
| 2739 | - } |
|
| 2740 | - break; |
|
| 2741 | - case 'binary': |
|
| 2742 | - $encoded = $str; |
|
| 2743 | - break; |
|
| 2744 | - case 'quoted-printable': |
|
| 2745 | - $encoded = $this->encodeQP($str); |
|
| 2746 | - break; |
|
| 2747 | - default: |
|
| 2748 | - $this->setError($this->lang('encoding') . $encoding); |
|
| 2749 | - break; |
|
| 2730 | + case 'base64': |
|
| 2731 | + $encoded = chunk_split(base64_encode($str), 76, $this->LE); |
|
| 2732 | + break; |
|
| 2733 | + case '7bit': |
|
| 2734 | + case '8bit': |
|
| 2735 | + $encoded = $this->fixEOL($str); |
|
| 2736 | + // Make sure it ends with a line break |
|
| 2737 | + if (substr($encoded, -(strlen($this->LE))) != $this->LE) { |
|
| 2738 | + $encoded .= $this->LE; |
|
| 2739 | + } |
|
| 2740 | + break; |
|
| 2741 | + case 'binary': |
|
| 2742 | + $encoded = $str; |
|
| 2743 | + break; |
|
| 2744 | + case 'quoted-printable': |
|
| 2745 | + $encoded = $this->encodeQP($str); |
|
| 2746 | + break; |
|
| 2747 | + default: |
|
| 2748 | + $this->setError($this->lang('encoding') . $encoding); |
|
| 2749 | + break; |
|
| 2750 | 2750 | } |
| 2751 | 2751 | return $encoded; |
| 2752 | 2752 | } |
@@ -2763,26 +2763,26 @@ discard block |
||
| 2763 | 2763 | { |
| 2764 | 2764 | $matchcount = 0; |
| 2765 | 2765 | switch (strtolower($position)) { |
| 2766 | - case 'phrase': |
|
| 2767 | - if (!preg_match('/[\200-\377]/', $str)) { |
|
| 2768 | - // Can't use addslashes as we don't know the value of magic_quotes_sybase |
|
| 2769 | - $encoded = addcslashes($str, "\0..\37\177\\\""); |
|
| 2770 | - if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { |
|
| 2771 | - return ($encoded); |
|
| 2772 | - } else { |
|
| 2773 | - return ("\"$encoded\""); |
|
| 2774 | - } |
|
| 2766 | + case 'phrase': |
|
| 2767 | + if (!preg_match('/[\200-\377]/', $str)) { |
|
| 2768 | + // Can't use addslashes as we don't know the value of magic_quotes_sybase |
|
| 2769 | + $encoded = addcslashes($str, "\0..\37\177\\\""); |
|
| 2770 | + if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { |
|
| 2771 | + return ($encoded); |
|
| 2772 | + } else { |
|
| 2773 | + return ("\"$encoded\""); |
|
| 2775 | 2774 | } |
| 2776 | - $matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); |
|
| 2777 | - break; |
|
| 2778 | - /** @noinspection PhpMissingBreakStatementInspection */ |
|
| 2779 | - case 'comment': |
|
| 2780 | - $matchcount = preg_match_all('/[()"]/', $str, $matches); |
|
| 2781 | - // Intentional fall-through |
|
| 2782 | - case 'text': |
|
| 2783 | - default: |
|
| 2784 | - $matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); |
|
| 2785 | - break; |
|
| 2775 | + } |
|
| 2776 | + $matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); |
|
| 2777 | + break; |
|
| 2778 | + /** @noinspection PhpMissingBreakStatementInspection */ |
|
| 2779 | + case 'comment': |
|
| 2780 | + $matchcount = preg_match_all('/[()"]/', $str, $matches); |
|
| 2781 | + // Intentional fall-through |
|
| 2782 | + case 'text': |
|
| 2783 | + default: |
|
| 2784 | + $matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); |
|
| 2785 | + break; |
|
| 2786 | 2786 | } |
| 2787 | 2787 | |
| 2788 | 2788 | //There are no chars that need encoding |
@@ -2941,22 +2941,22 @@ discard block |
||
| 2941 | 2941 | $pattern = ''; |
| 2942 | 2942 | $encoded = str_replace(array("\r", "\n"), '', $str); |
| 2943 | 2943 | switch (strtolower($position)) { |
| 2944 | - case 'phrase': |
|
| 2945 | - // RFC 2047 section 5.3 |
|
| 2946 | - $pattern = '^A-Za-z0-9!*+\/ -'; |
|
| 2947 | - break; |
|
| 2948 | - /** @noinspection PhpMissingBreakStatementInspection */ |
|
| 2949 | - case 'comment': |
|
| 2950 | - // RFC 2047 section 5.2 |
|
| 2951 | - $pattern = '\(\)"'; |
|
| 2952 | - // intentional fall-through |
|
| 2953 | - // for this reason we build the $pattern without including delimiters and [] |
|
| 2954 | - case 'text': |
|
| 2955 | - default: |
|
| 2956 | - // RFC 2047 section 5.1 |
|
| 2957 | - // Replace every high ascii, control, =, ? and _ characters |
|
| 2958 | - $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern; |
|
| 2959 | - break; |
|
| 2944 | + case 'phrase': |
|
| 2945 | + // RFC 2047 section 5.3 |
|
| 2946 | + $pattern = '^A-Za-z0-9!*+\/ -'; |
|
| 2947 | + break; |
|
| 2948 | + /** @noinspection PhpMissingBreakStatementInspection */ |
|
| 2949 | + case 'comment': |
|
| 2950 | + // RFC 2047 section 5.2 |
|
| 2951 | + $pattern = '\(\)"'; |
|
| 2952 | + // intentional fall-through |
|
| 2953 | + // for this reason we build the $pattern without including delimiters and [] |
|
| 2954 | + case 'text': |
|
| 2955 | + default: |
|
| 2956 | + // RFC 2047 section 5.1 |
|
| 2957 | + // Replace every high ascii, control, =, ? and _ characters |
|
| 2958 | + $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern; |
|
| 2959 | + break; |
|
| 2960 | 2960 | } |
| 2961 | 2961 | $matches = array(); |
| 2962 | 2962 | if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) { |
@@ -3649,20 +3649,20 @@ discard block |
||
| 3649 | 3649 | } |
| 3650 | 3650 | } |
| 3651 | 3651 | switch ($options) { |
| 3652 | - case PATHINFO_DIRNAME: |
|
| 3653 | - case 'dirname': |
|
| 3654 | - return $ret['dirname']; |
|
| 3655 | - case PATHINFO_BASENAME: |
|
| 3656 | - case 'basename': |
|
| 3657 | - return $ret['basename']; |
|
| 3658 | - case PATHINFO_EXTENSION: |
|
| 3659 | - case 'extension': |
|
| 3660 | - return $ret['extension']; |
|
| 3661 | - case PATHINFO_FILENAME: |
|
| 3662 | - case 'filename': |
|
| 3663 | - return $ret['filename']; |
|
| 3664 | - default: |
|
| 3665 | - return $ret; |
|
| 3652 | + case PATHINFO_DIRNAME: |
|
| 3653 | + case 'dirname': |
|
| 3654 | + return $ret['dirname']; |
|
| 3655 | + case PATHINFO_BASENAME: |
|
| 3656 | + case 'basename': |
|
| 3657 | + return $ret['basename']; |
|
| 3658 | + case PATHINFO_EXTENSION: |
|
| 3659 | + case 'extension': |
|
| 3660 | + return $ret['extension']; |
|
| 3661 | + case PATHINFO_FILENAME: |
|
| 3662 | + case 'filename': |
|
| 3663 | + return $ret['filename']; |
|
| 3664 | + default: |
|
| 3665 | + return $ret; |
|
| 3666 | 3666 | } |
| 3667 | 3667 | } |
| 3668 | 3668 | |
@@ -159,26 +159,26 @@ |
||
| 159 | 159 | public function step(&$client, $response, &$message, &$interactions) |
| 160 | 160 | { |
| 161 | 161 | switch ($this->state) { |
| 162 | - case SASL_NTLM_STATE_IDENTIFY_DOMAIN: |
|
| 163 | - $message = $this->typeMsg1($this->credentials["realm"], $this->credentials["workstation"]); |
|
| 164 | - $this->state = SASL_NTLM_STATE_RESPOND_CHALLENGE; |
|
| 165 | - break; |
|
| 166 | - case SASL_NTLM_STATE_RESPOND_CHALLENGE: |
|
| 167 | - $ntlm_response = $this->NTLMResponse(substr($response, 24, 8), $this->credentials["password"]); |
|
| 168 | - $message = $this->typeMsg3( |
|
| 169 | - $ntlm_response, |
|
| 170 | - $this->credentials["user"], |
|
| 171 | - $this->credentials["realm"], |
|
| 172 | - $this->credentials["workstation"] |
|
| 173 | - ); |
|
| 174 | - $this->state = SASL_NTLM_STATE_DONE; |
|
| 175 | - break; |
|
| 176 | - case SASL_NTLM_STATE_DONE: |
|
| 177 | - $client->error = "NTLM authentication was finished without success"; |
|
| 178 | - return (SASL_FAIL); |
|
| 179 | - default: |
|
| 180 | - $client->error = "invalid NTLM authentication step state"; |
|
| 181 | - return (SASL_FAIL); |
|
| 162 | + case SASL_NTLM_STATE_IDENTIFY_DOMAIN: |
|
| 163 | + $message = $this->typeMsg1($this->credentials["realm"], $this->credentials["workstation"]); |
|
| 164 | + $this->state = SASL_NTLM_STATE_RESPOND_CHALLENGE; |
|
| 165 | + break; |
|
| 166 | + case SASL_NTLM_STATE_RESPOND_CHALLENGE: |
|
| 167 | + $ntlm_response = $this->NTLMResponse(substr($response, 24, 8), $this->credentials["password"]); |
|
| 168 | + $message = $this->typeMsg3( |
|
| 169 | + $ntlm_response, |
|
| 170 | + $this->credentials["user"], |
|
| 171 | + $this->credentials["realm"], |
|
| 172 | + $this->credentials["workstation"] |
|
| 173 | + ); |
|
| 174 | + $this->state = SASL_NTLM_STATE_DONE; |
|
| 175 | + break; |
|
| 176 | + case SASL_NTLM_STATE_DONE: |
|
| 177 | + $client->error = "NTLM authentication was finished without success"; |
|
| 178 | + return (SASL_FAIL); |
|
| 179 | + default: |
|
| 180 | + $client->error = "invalid NTLM authentication step state"; |
|
| 181 | + return (SASL_FAIL); |
|
| 182 | 182 | } |
| 183 | 183 | return (SASL_CONTINUE); |
| 184 | 184 | } |
@@ -617,42 +617,42 @@ discard block |
||
| 617 | 617 | // first, disallow 8 bit characters and control characters |
| 618 | 618 | if (preg_match('/[\0-\37\200-\377]+/',$attvalue)) { |
| 619 | 619 | switch ($attname) { |
| 620 | - case 'href': |
|
| 621 | - $attvalue = $sQuote . 'http://invalid-stuff-detected.example.com' . $sQuote; |
|
| 622 | - break; |
|
| 623 | - default: |
|
| 624 | - $attvalue = $sQuote . $trans_image_path . $sQuote; |
|
| 625 | - break; |
|
| 620 | + case 'href': |
|
| 621 | + $attvalue = $sQuote . 'http://invalid-stuff-detected.example.com' . $sQuote; |
|
| 622 | + break; |
|
| 623 | + default: |
|
| 624 | + $attvalue = $sQuote . $trans_image_path . $sQuote; |
|
| 625 | + break; |
|
| 626 | 626 | } |
| 627 | 627 | } else { |
| 628 | 628 | $aUrl = parse_url($attvalue); |
| 629 | 629 | if (isset($aUrl['scheme'])) { |
| 630 | 630 | switch(strtolower($aUrl['scheme'])) { |
| 631 | - case 'mailto': |
|
| 632 | - case 'http': |
|
| 633 | - case 'https': |
|
| 634 | - case 'ftp': |
|
| 635 | - if ($attname != 'href') { |
|
| 636 | - if ($block_external_images == true) { |
|
| 631 | + case 'mailto': |
|
| 632 | + case 'http': |
|
| 633 | + case 'https': |
|
| 634 | + case 'ftp': |
|
| 635 | + if ($attname != 'href') { |
|
| 636 | + if ($block_external_images == true) { |
|
| 637 | + $attvalue = $sQuote . $trans_image_path . $sQuote; |
|
| 638 | + } else { |
|
| 639 | + if (!isset($aUrl['path'])) { |
|
| 637 | 640 | $attvalue = $sQuote . $trans_image_path . $sQuote; |
| 638 | - } else { |
|
| 639 | - if (!isset($aUrl['path'])) { |
|
| 640 | - $attvalue = $sQuote . $trans_image_path . $sQuote; |
|
| 641 | - } |
|
| 642 | 641 | } |
| 643 | - } else { |
|
| 644 | - $attvalue = $sQuote . $attvalue . $sQuote; |
|
| 645 | 642 | } |
| 646 | - break; |
|
| 647 | - case 'outbind': |
|
| 648 | - $attvalue = $sQuote . $attvalue . $sQuote; |
|
| 649 | - break; |
|
| 650 | - case 'cid': |
|
| 643 | + } else { |
|
| 651 | 644 | $attvalue = $sQuote . $attvalue . $sQuote; |
| 652 | - break; |
|
| 653 | - default: |
|
| 654 | - $attvalue = $sQuote . $trans_image_path . $sQuote; |
|
| 655 | - break; |
|
| 645 | + } |
|
| 646 | + break; |
|
| 647 | + case 'outbind': |
|
| 648 | + $attvalue = $sQuote . $attvalue . $sQuote; |
|
| 649 | + break; |
|
| 650 | + case 'cid': |
|
| 651 | + $attvalue = $sQuote . $attvalue . $sQuote; |
|
| 652 | + break; |
|
| 653 | + default: |
|
| 654 | + $attvalue = $sQuote . $trans_image_path . $sQuote; |
|
| 655 | + break; |
|
| 656 | 656 | } |
| 657 | 657 | } else { |
| 658 | 658 | if (!isset($aUrl['path']) || $aUrl['path'] != $trans_image_path) { |
@@ -673,53 +673,53 @@ discard block |
||
| 673 | 673 | for ($i=$pos,$iCount=strlen($body);$i<$iCount;++$i) { |
| 674 | 674 | $char = $body{$i}; |
| 675 | 675 | switch ($char) { |
| 676 | - case '<': |
|
| 677 | - $sToken = $char; |
|
| 678 | - break; |
|
| 679 | - case '/': |
|
| 680 | - if ($sToken == '<') { |
|
| 681 | - $sToken .= $char; |
|
| 682 | - $bEndTag = true; |
|
| 683 | - } else { |
|
| 684 | - $content .= $char; |
|
| 685 | - } |
|
| 686 | - break; |
|
| 687 | - case '>': |
|
| 688 | - if ($bEndTag) { |
|
| 689 | - $sToken .= $char; |
|
| 690 | - if (preg_match('/\<\/\s*style\s*\>/i',$sToken,$aMatch)) { |
|
| 691 | - $newpos = $i + 1; |
|
| 692 | - $bSucces = true; |
|
| 693 | - break 2; |
|
| 694 | - } else { |
|
| 695 | - $content .= $sToken; |
|
| 696 | - } |
|
| 697 | - $bEndTag = false; |
|
| 698 | - } else { |
|
| 699 | - $content .= $char; |
|
| 700 | - } |
|
| 701 | - break; |
|
| 702 | - case '!': |
|
| 703 | - if ($sToken == '<') { |
|
| 704 | - // possible comment |
|
| 705 | - if (isset($body{$i+2}) && substr($body,$i,3) == '!--') { |
|
| 706 | - $i = strpos($body,'-->',$i+3); |
|
| 707 | - if ($i === false) { // no end comment |
|
| 708 | - $i = strlen($body); |
|
| 709 | - } |
|
| 710 | - $sToken = ''; |
|
| 711 | - } |
|
| 676 | + case '<': |
|
| 677 | + $sToken = $char; |
|
| 678 | + break; |
|
| 679 | + case '/': |
|
| 680 | + if ($sToken == '<') { |
|
| 681 | + $sToken .= $char; |
|
| 682 | + $bEndTag = true; |
|
| 683 | + } else { |
|
| 684 | + $content .= $char; |
|
| 685 | + } |
|
| 686 | + break; |
|
| 687 | + case '>': |
|
| 688 | + if ($bEndTag) { |
|
| 689 | + $sToken .= $char; |
|
| 690 | + if (preg_match('/\<\/\s*style\s*\>/i',$sToken,$aMatch)) { |
|
| 691 | + $newpos = $i + 1; |
|
| 692 | + $bSucces = true; |
|
| 693 | + break 2; |
|
| 712 | 694 | } else { |
| 713 | - $content .= $char; |
|
| 695 | + $content .= $sToken; |
|
| 714 | 696 | } |
| 715 | - break; |
|
| 716 | - default: |
|
| 717 | - if ($bEndTag) { |
|
| 718 | - $sToken .= $char; |
|
| 719 | - } else { |
|
| 720 | - $content .= $char; |
|
| 697 | + $bEndTag = false; |
|
| 698 | + } else { |
|
| 699 | + $content .= $char; |
|
| 700 | + } |
|
| 701 | + break; |
|
| 702 | + case '!': |
|
| 703 | + if ($sToken == '<') { |
|
| 704 | + // possible comment |
|
| 705 | + if (isset($body{$i+2}) && substr($body,$i,3) == '!--') { |
|
| 706 | + $i = strpos($body,'-->',$i+3); |
|
| 707 | + if ($i === false) { // no end comment |
|
| 708 | + $i = strlen($body); |
|
| 709 | + } |
|
| 710 | + $sToken = ''; |
|
| 721 | 711 | } |
| 722 | - break; |
|
| 712 | + } else { |
|
| 713 | + $content .= $char; |
|
| 714 | + } |
|
| 715 | + break; |
|
| 716 | + default: |
|
| 717 | + if ($bEndTag) { |
|
| 718 | + $sToken .= $char; |
|
| 719 | + } else { |
|
| 720 | + $content .= $char; |
|
| 721 | + } |
|
| 722 | + break; |
|
| 723 | 723 | } |
| 724 | 724 | } |
| 725 | 725 | if ($bSucces == FALSE){ |
@@ -799,17 +799,17 @@ discard block |
||
| 799 | 799 | $quotchar = substr($attvalue, 0, 1); |
| 800 | 800 | $attvalue = str_replace($quotchar, "", $attvalue); |
| 801 | 801 | switch ($attname){ |
| 802 | - case 'background': |
|
| 803 | - $styledef .= "background-image: url('$trans_image_path'); "; |
|
| 804 | - break; |
|
| 805 | - case 'bgcolor': |
|
| 806 | - $has_bgc_stl = true; |
|
| 807 | - $styledef .= "background-color: $attvalue; "; |
|
| 808 | - break; |
|
| 809 | - case 'text': |
|
| 810 | - $has_txt_stl = true; |
|
| 811 | - $styledef .= "color: $attvalue; "; |
|
| 812 | - break; |
|
| 802 | + case 'background': |
|
| 803 | + $styledef .= "background-image: url('$trans_image_path'); "; |
|
| 804 | + break; |
|
| 805 | + case 'bgcolor': |
|
| 806 | + $has_bgc_stl = true; |
|
| 807 | + $styledef .= "background-color: $attvalue; "; |
|
| 808 | + break; |
|
| 809 | + case 'text': |
|
| 810 | + $has_txt_stl = true; |
|
| 811 | + $styledef .= "color: $attvalue; "; |
|
| 812 | + break; |
|
| 813 | 813 | } |
| 814 | 814 | } |
| 815 | 815 | // Outlook defines a white bgcolor and no text color. This can lead to |
@@ -382,16 +382,16 @@ discard block |
||
| 382 | 382 | // Store the menu item since it has some useful information. |
| 383 | 383 | $vars['menu_item'] = menu_get_item(); |
| 384 | 384 | switch ($vars['menu_item']['page_callback']) { |
| 385 | - case 'views_page': |
|
| 386 | - // Is this a Views page? |
|
| 387 | - $vars['classes_array'][] = 'page-views'; |
|
| 388 | - break; |
|
| 389 | - case 'page_manager_page_execute': |
|
| 390 | - case 'page_manager_node_view': |
|
| 391 | - case 'page_manager_contact_site': |
|
| 392 | - // Is this a Panels page? |
|
| 393 | - $vars['classes_array'][] = 'page-panels'; |
|
| 394 | - break; |
|
| 385 | + case 'views_page': |
|
| 386 | + // Is this a Views page? |
|
| 387 | + $vars['classes_array'][] = 'page-views'; |
|
| 388 | + break; |
|
| 389 | + case 'page_manager_page_execute': |
|
| 390 | + case 'page_manager_node_view': |
|
| 391 | + case 'page_manager_contact_site': |
|
| 392 | + // Is this a Panels page? |
|
| 393 | + $vars['classes_array'][] = 'page-panels'; |
|
| 394 | + break; |
|
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | |
@@ -428,31 +428,31 @@ discard block |
||
| 428 | 428 | function zen_preprocess_node(&$vars, $hook) { |
| 429 | 429 | // Create the build_mode variable. |
| 430 | 430 | switch ($vars['node']->build_mode) { |
| 431 | - case NODE_BUILD_NORMAL: |
|
| 432 | - if ($vars['node']->build_mode === NODE_BUILD_NORMAL) { |
|
| 433 | - $vars['build_mode'] = $vars['teaser'] ? 'teaser' : 'full'; |
|
| 434 | - } |
|
| 435 | - else { |
|
| 436 | - $vars['build_mode'] = $vars['node']->build_mode; |
|
| 437 | - } |
|
| 438 | - break; |
|
| 439 | - case NODE_BUILD_PREVIEW: |
|
| 440 | - $vars['build_mode'] = 'preview'; |
|
| 441 | - break; |
|
| 442 | - case NODE_BUILD_SEARCH_INDEX: |
|
| 443 | - $vars['build_mode'] = 'search_index'; |
|
| 444 | - break; |
|
| 445 | - case NODE_BUILD_SEARCH_RESULT: |
|
| 446 | - $vars['build_mode'] = 'search_result'; |
|
| 447 | - break; |
|
| 448 | - case NODE_BUILD_RSS: |
|
| 449 | - $vars['build_mode'] = 'rss'; |
|
| 450 | - break; |
|
| 451 | - case NODE_BUILD_PRINT: |
|
| 452 | - $vars['build_mode'] = 'print'; |
|
| 453 | - break; |
|
| 454 | - default: |
|
| 431 | + case NODE_BUILD_NORMAL: |
|
| 432 | + if ($vars['node']->build_mode === NODE_BUILD_NORMAL) { |
|
| 433 | + $vars['build_mode'] = $vars['teaser'] ? 'teaser' : 'full'; |
|
| 434 | + } |
|
| 435 | + else { |
|
| 455 | 436 | $vars['build_mode'] = $vars['node']->build_mode; |
| 437 | + } |
|
| 438 | + break; |
|
| 439 | + case NODE_BUILD_PREVIEW: |
|
| 440 | + $vars['build_mode'] = 'preview'; |
|
| 441 | + break; |
|
| 442 | + case NODE_BUILD_SEARCH_INDEX: |
|
| 443 | + $vars['build_mode'] = 'search_index'; |
|
| 444 | + break; |
|
| 445 | + case NODE_BUILD_SEARCH_RESULT: |
|
| 446 | + $vars['build_mode'] = 'search_result'; |
|
| 447 | + break; |
|
| 448 | + case NODE_BUILD_RSS: |
|
| 449 | + $vars['build_mode'] = 'rss'; |
|
| 450 | + break; |
|
| 451 | + case NODE_BUILD_PRINT: |
|
| 452 | + $vars['build_mode'] = 'print'; |
|
| 453 | + break; |
|
| 454 | + default: |
|
| 455 | + $vars['build_mode'] = $vars['node']->build_mode; |
|
| 456 | 456 | } |
| 457 | 457 | |
| 458 | 458 | // Create the user_picture variable. |
@@ -80,20 +80,20 @@ |
||
| 80 | 80 | |
| 81 | 81 | function upload_error_description($errno) { |
| 82 | 82 | switch($errno) { |
| 83 | - case UPLOAD_ERR_INI_SIZE: |
|
| 84 | - return "The uploaded file exceeds upload_max_filesize of php.ini."; break; |
|
| 85 | - case UPLOAD_ERR_FORM_SIZE: |
|
| 86 | - return "The uploaded file exceeds the MAX_FILE_SIZE specified in the HTML form."; break; |
|
| 87 | - case UPLOAD_ERR_PARTIAL: |
|
| 88 | - return "The uploaded file was only partially uploaded."; break; |
|
| 89 | - case UPLOAD_ERR_NO_FILE: |
|
| 90 | - return "No file was uploaded."; break; |
|
| 91 | - case UPLOAD_ERR_NO_TMP_DIR: |
|
| 92 | - return "Missing a temporary folder."; break; |
|
| 93 | - case UPLOAD_ERR_CANT_WRITE: |
|
| 94 | - return "Failed to write file to disk."; break; |
|
| 95 | - case UPLOAD_ERR_EXTENSION: |
|
| 96 | - return "A PHP extension stopped the file upload."; break; |
|
| 83 | + case UPLOAD_ERR_INI_SIZE: |
|
| 84 | + return "The uploaded file exceeds upload_max_filesize of php.ini."; break; |
|
| 85 | + case UPLOAD_ERR_FORM_SIZE: |
|
| 86 | + return "The uploaded file exceeds the MAX_FILE_SIZE specified in the HTML form."; break; |
|
| 87 | + case UPLOAD_ERR_PARTIAL: |
|
| 88 | + return "The uploaded file was only partially uploaded."; break; |
|
| 89 | + case UPLOAD_ERR_NO_FILE: |
|
| 90 | + return "No file was uploaded."; break; |
|
| 91 | + case UPLOAD_ERR_NO_TMP_DIR: |
|
| 92 | + return "Missing a temporary folder."; break; |
|
| 93 | + case UPLOAD_ERR_CANT_WRITE: |
|
| 94 | + return "Failed to write file to disk."; break; |
|
| 95 | + case UPLOAD_ERR_EXTENSION: |
|
| 96 | + return "A PHP extension stopped the file upload."; break; |
|
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
@@ -55,14 +55,14 @@ |
||
| 55 | 55 | |
| 56 | 56 | // TODO: create a function for this in forum_banishment_vote.inc to make it more flexible |
| 57 | 57 | switch (post_int("category", true)) { |
| 58 | - case 1: |
|
| 59 | - $mod_category = tra("Obscene"); |
|
| 60 | - case 2: |
|
| 61 | - $mod_category = tra("Flame/Hate mail"); |
|
| 62 | - case 3: |
|
| 63 | - $mod_category = tra("User Request"); |
|
| 64 | - default: |
|
| 65 | - $mod_category = tra("Other"); |
|
| 58 | +case 1: |
|
| 59 | + $mod_category = tra("Obscene"); |
|
| 60 | +case 2: |
|
| 61 | + $mod_category = tra("Flame/Hate mail"); |
|
| 62 | +case 3: |
|
| 63 | + $mod_category = tra("User Request"); |
|
| 64 | +default: |
|
| 65 | + $mod_category = tra("Other"); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | if (post_str('reason', true)){ |
@@ -36,12 +36,12 @@ |
||
| 36 | 36 | |
| 37 | 37 | function hide_explanation() { |
| 38 | 38 | switch (post_int("category", true)) { |
| 39 | - case 1: $c = "Obscene"; break; |
|
| 40 | - case 2: $c = "Flame/Hate mail"; break; |
|
| 41 | - case 3: $c = "Commercial spam"; break; |
|
| 42 | - case 4: $c = "Double post"; break; |
|
| 43 | - case 5: $c = "User Request"; break; |
|
| 44 | - default: $c = "Other"; break; |
|
| 39 | + case 1: $c = "Obscene"; break; |
|
| 40 | + case 2: $c = "Flame/Hate mail"; break; |
|
| 41 | + case 3: $c = "Commercial spam"; break; |
|
| 42 | + case 4: $c = "Double post"; break; |
|
| 43 | + case 5: $c = "User Request"; break; |
|
| 44 | + default: $c = "Other"; break; |
|
| 45 | 45 | } |
| 46 | 46 | $x = "\nYour post was categorized as ".$c; |
| 47 | 47 | $x .= mod_comment(); |