@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | $addresses = array(); |
| 396 | 396 | foreach ($pairs as $name => $email) { |
| 397 | 397 | if (is_numeric($name)) { |
| 398 | - $name = null; |
|
| 398 | + $name = null; |
|
| 399 | 399 | } |
| 400 | 400 | $addresses[] = $this->formatHeader($email, $name); |
| 401 | 401 | } |
@@ -837,10 +837,10 @@ discard block |
||
| 837 | 837 | return $headers; |
| 838 | 838 | } |
| 839 | 839 | |
| 840 | - /** |
|
| 841 | - * Get the attachment message for send or the simple message |
|
| 842 | - * @return string |
|
| 843 | - */ |
|
| 840 | + /** |
|
| 841 | + * Get the attachment message for send or the simple message |
|
| 842 | + * @return string |
|
| 843 | + */ |
|
| 844 | 844 | protected function getMessageWithAttachmentForSend() { |
| 845 | 845 | $message = $this->getWrapMessage(); |
| 846 | 846 | if ($this->hasAttachments()) { |
@@ -870,7 +870,7 @@ discard block |
||
| 870 | 870 | */ |
| 871 | 871 | protected function sendHelloCommand() { |
| 872 | 872 | $responseCode = $this->sendCommand('EHLO ' . $this->getSmtpClientHostname()) |
| 873 | - ->getSmtpResponseCode(); |
|
| 873 | + ->getSmtpResponseCode(); |
|
| 874 | 874 | if ($responseCode !== 250) { |
| 875 | 875 | $this->error = $this->smtpResponse; |
| 876 | 876 | return false; |
@@ -1017,7 +1017,7 @@ discard block |
||
| 1017 | 1017 | $message = $this->getMessageWithAttachmentForSend(); |
| 1018 | 1018 | $headers = $this->getHeadersForSend(); |
| 1019 | 1019 | $this->logger->info('Sending new mail using mail protocol, the information are listed below: ' |
| 1020 | - . 'destination: ' . $to . ', headers: ' . $headers . ', message: ' . $message); |
|
| 1020 | + . 'destination: ' . $to . ', headers: ' . $headers . ', message: ' . $message); |
|
| 1021 | 1021 | $result = mail($to, $this->subject, $message, $headers, $this->params); |
| 1022 | 1022 | if (!$result) { |
| 1023 | 1023 | $this->error = 'Error when sending mail using mail protocol'; |
@@ -1025,10 +1025,10 @@ discard block |
||
| 1025 | 1025 | return $result; |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | - /** |
|
| 1029 | - * Send mail using "smtp" protocol |
|
| 1030 | - * @return boolean |
|
| 1031 | - */ |
|
| 1028 | + /** |
|
| 1029 | + * Send mail using "smtp" protocol |
|
| 1030 | + * @return boolean |
|
| 1031 | + */ |
|
| 1032 | 1032 | protected function sendSmtp() { |
| 1033 | 1033 | if (!$this->smtpConnection()) { |
| 1034 | 1034 | return false; |
@@ -1038,7 +1038,7 @@ discard block |
||
| 1038 | 1038 | $message = $this->getMessageWithAttachmentForSend(); |
| 1039 | 1039 | $headers = $this->getHeadersForSend(); |
| 1040 | 1040 | $this->logger->info('Sending new mail using SMTP protocol, the information are listed below: ' |
| 1041 | - . 'destination: ' . $to . ', headers: ' . $headers . ', message: ' . $message); |
|
| 1041 | + . 'destination: ' . $to . ', headers: ' . $headers . ', message: ' . $message); |
|
| 1042 | 1042 | $recipients = array_merge($this->to, $this->cc, $this->bcc); |
| 1043 | 1043 | $commands = array( |
| 1044 | 1044 | 'mail_from' => array('MAIL FROM: <' . $this->from . '>', 'MAIL_FROM', 250), |
@@ -1089,17 +1089,17 @@ discard block |
||
| 1089 | 1089 | } |
| 1090 | 1090 | |
| 1091 | 1091 | |
| 1092 | - /** |
|
| 1093 | - * Return the client hostname for SMTP |
|
| 1094 | - * |
|
| 1095 | - * There are only two legal types of hostname - either a fully |
|
| 1096 | - * qualified domain name (eg: "mail.example.com") or an IP literal |
|
| 1097 | - * (eg: "[1.2.3.4]"). |
|
| 1098 | - * |
|
| 1099 | - * @link https://tools.ietf.org/html/rfc5321#section-2.3.5 |
|
| 1100 | - * @link http://cbl.abuseat.org/namingproblems.html |
|
| 1101 | - * @return string |
|
| 1102 | - */ |
|
| 1092 | + /** |
|
| 1093 | + * Return the client hostname for SMTP |
|
| 1094 | + * |
|
| 1095 | + * There are only two legal types of hostname - either a fully |
|
| 1096 | + * qualified domain name (eg: "mail.example.com") or an IP literal |
|
| 1097 | + * (eg: "[1.2.3.4]"). |
|
| 1098 | + * |
|
| 1099 | + * @link https://tools.ietf.org/html/rfc5321#section-2.3.5 |
|
| 1100 | + * @link http://cbl.abuseat.org/namingproblems.html |
|
| 1101 | + * @return string |
|
| 1102 | + */ |
|
| 1103 | 1103 | protected function getSmtpClientHostname() { |
| 1104 | 1104 | $globals = &class_loader('GlobalVar', 'classes'); |
| 1105 | 1105 | if ($globals->server('SERVER_NAME')) { |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | if ($cookieLang && $this->isValid($cookieLang)) { |
| 80 | 80 | $this->current = $cookieLang; |
| 81 | 81 | $this->logger->info('Language from cookie [' . $cfgKey . '] is valid so ' |
| 82 | - .'we will set the language using the cookie value [' . $cookieLang . ']'); |
|
| 82 | + .'we will set the language using the cookie value [' . $cookieLang . ']'); |
|
| 83 | 83 | } else { |
| 84 | 84 | $this->logger->info('Language from cookie [' . $cfgKey . '] is not set, use the default value [' . $this->getDefault() . ']'); |
| 85 | 85 | $this->current = $this->getDefault(); |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $this->logger->info('Cannot find view [' . $view . '] in module [' . $module . '] ' |
| 186 | 186 | . 'using the default location'); |
| 187 | 187 | } |
| 188 | - if (!$path) { |
|
| 188 | + if (!$path) { |
|
| 189 | 189 | $path = $this->getDefaultFilePathForView($viewFile); |
| 190 | 190 | } |
| 191 | 191 | $this->logger->info('The view file path to be loaded is [' . $path . ']'); |
@@ -261,12 +261,12 @@ discard block |
||
| 261 | 261 | return $this->finalPageContent; |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | - /** |
|
| 265 | - * Set the final page to be rendered |
|
| 266 | - * @param string $finalPage the content of the final page |
|
| 267 | - * |
|
| 268 | - * @return object |
|
| 269 | - */ |
|
| 264 | + /** |
|
| 265 | + * Set the final page to be rendered |
|
| 266 | + * @param string $finalPage the content of the final page |
|
| 267 | + * |
|
| 268 | + * @return object |
|
| 269 | + */ |
|
| 270 | 270 | public function setFinalPageContent($finalPage) { |
| 271 | 271 | $this->finalPageContent = $finalPage; |
| 272 | 272 | return $this; |
@@ -340,11 +340,11 @@ discard block |
||
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | /** |
| 343 | - * Dispatch the FINAL_VIEW_READY event |
|
| 344 | - * |
|
| 345 | - * @return string|null the final view content after processing by each listener |
|
| 346 | - * if they exists otherwise the same content will be returned |
|
| 347 | - */ |
|
| 343 | + * Dispatch the FINAL_VIEW_READY event |
|
| 344 | + * |
|
| 345 | + * @return string|null the final view content after processing by each listener |
|
| 346 | + * if they exists otherwise the same content will be returned |
|
| 347 | + */ |
|
| 348 | 348 | protected function dispatchFinalViewEvent() { |
| 349 | 349 | //dispatch |
| 350 | 350 | $event = get_instance()->eventdispatcher->dispatch( |
@@ -389,12 +389,12 @@ discard block |
||
| 389 | 389 | && (bool) ini_get('zlib.output_compression') === false; |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | - /** |
|
| 393 | - * Return the default full file path for view |
|
| 394 | - * @param string $file the filename |
|
| 395 | - * |
|
| 396 | - * @return string|null the full file path |
|
| 397 | - */ |
|
| 392 | + /** |
|
| 393 | + * Return the default full file path for view |
|
| 394 | + * @param string $file the filename |
|
| 395 | + * |
|
| 396 | + * @return string|null the full file path |
|
| 397 | + */ |
|
| 398 | 398 | protected function getDefaultFilePathForView($file){ |
| 399 | 399 | $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH); |
| 400 | 400 | $fullFilePath = null; |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | $headerModifiedSince = $globals->server('HTTP_IF_MODIFIED_SINCE'); |
| 428 | 428 | if (!empty($headerModifiedSince) && $lastModified <= strtotime($headerModifiedSince)) { |
| 429 | 429 | $this->logger->info('The cache page content is not yet expire for the ' |
| 430 | - . 'URL [' . $this->currentUrl . '] send 304 header to browser'); |
|
| 430 | + . 'URL [' . $this->currentUrl . '] send 304 header to browser'); |
|
| 431 | 431 | $this->sendHeaders(304); |
| 432 | 432 | return true; |
| 433 | 433 | } |
@@ -442,8 +442,8 @@ discard block |
||
| 442 | 442 | */ |
| 443 | 443 | protected function sendCachePageContentToBrowser(&$cache) { |
| 444 | 444 | $this->logger->info('The cache page content is expired or the browser does ' |
| 445 | - . 'not send the HTTP_IF_MODIFIED_SINCE header for the URL [' . $this->currentUrl . '] ' |
|
| 446 | - . 'send cache headers to tell the browser'); |
|
| 445 | + . 'not send the HTTP_IF_MODIFIED_SINCE header for the URL [' . $this->currentUrl . '] ' |
|
| 446 | + . 'send cache headers to tell the browser'); |
|
| 447 | 447 | $this->sendHeaders(200); |
| 448 | 448 | //current page cache key |
| 449 | 449 | $pageCacheKey = $this->currentUrlCacheKey; |
@@ -582,18 +582,18 @@ discard block |
||
| 582 | 582 | } |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | - /** |
|
| 586 | - * Set the mandory headers, like security, etc. |
|
| 587 | - */ |
|
| 585 | + /** |
|
| 586 | + * Set the mandory headers, like security, etc. |
|
| 587 | + */ |
|
| 588 | 588 | protected function setRequiredHeaders() { |
| 589 | 589 | $requiredHeaders = array( |
| 590 | 590 | 'X-XSS-Protection' => '1; mode=block', |
| 591 | 591 | 'X-Frame-Options' => 'SAMEORIGIN' |
| 592 | 592 | ); |
| 593 | 593 | foreach ($requiredHeaders as $key => $value) { |
| 594 | - if (!isset($this->headers[$key])) { |
|
| 594 | + if (!isset($this->headers[$key])) { |
|
| 595 | 595 | $this->headers[$key] = $value; |
| 596 | - } |
|
| 596 | + } |
|
| 597 | 597 | } |
| 598 | 598 | } |
| 599 | 599 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | $moduleConfigPath = get_instance()->module->findConfigFullPath($filename, $module); |
| 220 | 220 | if ($moduleConfigPath) { |
| 221 | 221 | $this->logger->info('Found config [' . $filename . '] from module [' . $module . '], ' |
| 222 | - . 'the file path is [' . $moduleConfigPath . '] we will used it'); |
|
| 222 | + . 'the file path is [' . $moduleConfigPath . '] we will used it'); |
|
| 223 | 223 | $configFilePath = $moduleConfigPath; |
| 224 | 224 | } else { |
| 225 | 225 | $this->logger->info('Cannot find config [' . $filename . '] from modules using the default location'); |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | $moduleLibraryPath = get_instance()->module->findLibraryFullPath($class, $module); |
| 480 | 480 | if ($moduleLibraryPath) { |
| 481 | 481 | $this->logger->info('Found library [' . $class . '] from module [' . $module . '], the ' |
| 482 | - . 'file path is [' . $moduleLibraryPath . '] we will used it'); |
|
| 482 | + . 'file path is [' . $moduleLibraryPath . '] we will used it'); |
|
| 483 | 483 | $libraryFilePath = $moduleLibraryPath; |
| 484 | 484 | } else { |
| 485 | 485 | $this->logger->info('Cannot find library [' . $class . '] from modules using the default location'); |