@@ -2,10 +2,10 @@ |
||
| 2 | 2 | |
| 3 | 3 | # Mime types |
| 4 | 4 | |
| 5 | -define('MIME_TYPE_HTML', 'html'); |
|
| 6 | -define('MIME_TYPE_XML', 'xml'); |
|
| 7 | -define('MIME_TYPE_JSON', 'json'); |
|
| 5 | +define('MIME_TYPE_HTML', 'html'); |
|
| 6 | +define('MIME_TYPE_XML', 'xml'); |
|
| 7 | +define('MIME_TYPE_JSON', 'json'); |
|
| 8 | 8 | |
| 9 | -define('MIME_TYPE_JPEG', 'jpeg'); |
|
| 10 | -define('MIME_TYPE_PNG', 'png'); |
|
| 11 | -define('MIME_TYPE_GIF', 'gif'); |
|
| 9 | +define('MIME_TYPE_JPEG', 'jpeg'); |
|
| 10 | +define('MIME_TYPE_PNG', 'png'); |
|
| 11 | +define('MIME_TYPE_GIF', 'gif'); |
|
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | define('REGEX_TEMPLATE_ITEM_NAME', '/^(?![0-9_])(?!.*_$)(?!.*_{2,})[a-zA-Z0-9_]+$/'); |
| 15 | 15 | |
| 16 | 16 | define('REGEX_TEMPLATE_STRUCTURE', '/(?s){[ ]*(!)?[ ]*(block|for|widget)[ ]*:[ ]*([a-zA-Z0-9_]+)[ ]*' . |
| 17 | - '(?:\/[ ]*}|}(.*?){[ ]*\/[ ]*\2[ ]*:[ ]*\3[ ]*})/'); |
|
| 17 | + '(?:\/[ ]*}|}(.*?){[ ]*\/[ ]*\2[ ]*:[ ]*\3[ ]*})/'); |
|
| 18 | 18 | |
| 19 | 19 | define('REGEX_TEMPLATE_VARIABLE', '/\$([a-zA-Z0-9_]+)\$/'); |
| 20 | 20 | define('REGEX_TEMPLATE_PHRASE', '/\%([a-zA-Z0-9_]+)\%/'); |
@@ -2,19 +2,19 @@ |
||
| 2 | 2 | |
| 3 | 3 | # Form expressions |
| 4 | 4 | |
| 5 | -define('REGEX_FORM_NAME', '/^[a-zA-Z][a-zA-Z0-9]*$/'); |
|
| 6 | -define('REGEX_FORM_FIELD_KEY', '/^(?![0-9_])(?!.*_$)(?!.*_{2,})[a-zA-Z0-9_]+$/'); |
|
| 5 | +define('REGEX_FORM_NAME', '/^[a-zA-Z][a-zA-Z0-9]*$/'); |
|
| 6 | +define('REGEX_FORM_FIELD_KEY', '/^(?![0-9_])(?!.*_$)(?!.*_{2,})[a-zA-Z0-9_]+$/'); |
|
| 7 | 7 | |
| 8 | 8 | # Language expressions |
| 9 | 9 | |
| 10 | -define('REGEX_LANGUAGE_PHRASE_NAME', '/^(?![0-9_])(?!.*_$)(?!.*_{2,})[a-zA-Z0-9_]+$/'); |
|
| 10 | +define('REGEX_LANGUAGE_PHRASE_NAME', '/^(?![0-9_])(?!.*_$)(?!.*_{2,})[a-zA-Z0-9_]+$/'); |
|
| 11 | 11 | |
| 12 | 12 | # Template expressions |
| 13 | 13 | |
| 14 | -define('REGEX_TEMPLATE_ITEM_NAME', '/^(?![0-9_])(?!.*_$)(?!.*_{2,})[a-zA-Z0-9_]+$/'); |
|
| 14 | +define('REGEX_TEMPLATE_ITEM_NAME', '/^(?![0-9_])(?!.*_$)(?!.*_{2,})[a-zA-Z0-9_]+$/'); |
|
| 15 | 15 | |
| 16 | -define('REGEX_TEMPLATE_STRUCTURE', '/(?s){[ ]*(!)?[ ]*(block|for|widget)[ ]*:[ ]*([a-zA-Z0-9_]+)[ ]*' . |
|
| 16 | +define('REGEX_TEMPLATE_STRUCTURE', '/(?s){[ ]*(!)?[ ]*(block|for|widget)[ ]*:[ ]*([a-zA-Z0-9_]+)[ ]*'. |
|
| 17 | 17 | '(?:\/[ ]*}|}(.*?){[ ]*\/[ ]*\2[ ]*:[ ]*\3[ ]*})/'); |
| 18 | 18 | |
| 19 | -define('REGEX_TEMPLATE_VARIABLE', '/\$([a-zA-Z0-9_]+)\$/'); |
|
| 20 | -define('REGEX_TEMPLATE_PHRASE', '/\%([a-zA-Z0-9_]+)\%/'); |
|
| 19 | +define('REGEX_TEMPLATE_VARIABLE', '/\$([a-zA-Z0-9_]+)\$/'); |
|
| 20 | +define('REGEX_TEMPLATE_PHRASE', '/\%([a-zA-Z0-9_]+)\%/'); |
|
@@ -2,28 +2,28 @@ |
||
| 2 | 2 | |
| 3 | 3 | # Cache limiters |
| 4 | 4 | |
| 5 | -define('CACHE_LIMITER_PRIVATE', 'private'); |
|
| 6 | -define('CACHE_LIMITER_PUBLIC', 'public'); |
|
| 5 | +define('CACHE_LIMITER_PRIVATE', 'private'); |
|
| 6 | +define('CACHE_LIMITER_PUBLIC', 'public'); |
|
| 7 | 7 | |
| 8 | 8 | # Date formats |
| 9 | 9 | |
| 10 | -define('DATE_FORMAT_STANDART', 'd.m.Y'); |
|
| 11 | -define('DATE_FORMAT_MYSQL', 'Y-m-d'); |
|
| 12 | -define('DATE_FORMAT_DATETIME', 'd.m.Y, H:i'); |
|
| 13 | -define('DATE_FORMAT_W3C', 'Y-m-d\TH:i:sP'); |
|
| 10 | +define('DATE_FORMAT_STANDART', 'd.m.Y'); |
|
| 11 | +define('DATE_FORMAT_MYSQL', 'Y-m-d'); |
|
| 12 | +define('DATE_FORMAT_DATETIME', 'd.m.Y, H:i'); |
|
| 13 | +define('DATE_FORMAT_W3C', 'Y-m-d\TH:i:sP'); |
|
| 14 | 14 | |
| 15 | 15 | # Form fields |
| 16 | 16 | |
| 17 | -define('FORM_FIELD_HIDDEN', 'hidden'); |
|
| 18 | -define('FORM_FIELD_PASSWORD', 'password'); |
|
| 19 | -define('FORM_FIELD_CAPTCHA', 'captcha'); |
|
| 20 | -define('FORM_FIELD_TEXT', 'text'); |
|
| 21 | -define('FORM_FIELD_TEXTAREA', 'textarea'); |
|
| 17 | +define('FORM_FIELD_HIDDEN', 'hidden'); |
|
| 18 | +define('FORM_FIELD_PASSWORD', 'password'); |
|
| 19 | +define('FORM_FIELD_CAPTCHA', 'captcha'); |
|
| 20 | +define('FORM_FIELD_TEXT', 'text'); |
|
| 21 | +define('FORM_FIELD_TEXTAREA', 'textarea'); |
|
| 22 | 22 | |
| 23 | 23 | # String pools |
| 24 | 24 | |
| 25 | -define('STR_POOL_DEFAULT', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'); |
|
| 26 | -define('STR_POOL_LATIN', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'); |
|
| 27 | -define('STR_POOL_LATIN_LOWER', 'abcdefghijklmnopqrstuvwxyz'); |
|
| 28 | -define('STR_POOL_LATIN_UPPER', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'); |
|
| 29 | -define('STR_POOL_NUMERIC', '0123456789'); |
|
| 25 | +define('STR_POOL_DEFAULT', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'); |
|
| 26 | +define('STR_POOL_LATIN', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'); |
|
| 27 | +define('STR_POOL_LATIN_LOWER', 'abcdefghijklmnopqrstuvwxyz'); |
|
| 28 | +define('STR_POOL_LATIN_UPPER', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'); |
|
| 29 | +define('STR_POOL_NUMERIC', '0123456789'); |
|
@@ -32,28 +32,28 @@ |
||
| 32 | 32 | |
| 33 | 33 | # Class load exception |
| 34 | 34 | |
| 35 | - class ClassLoad extends Exception { |
|
| 35 | + class ClassLoad extends Exception { |
|
| 36 | 36 | |
| 37 | 37 | protected $message = 'Class \'$value$\' not found'; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | # Database connect exception |
| 41 | 41 | |
| 42 | - class DBConnect extends Exception { |
|
| 42 | + class DBConnect extends Exception { |
|
| 43 | 43 | |
| 44 | 44 | protected $message = 'Unable to connect to database'; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | # Database select exception |
| 48 | 48 | |
| 49 | - class DBSelect extends Exception { |
|
| 49 | + class DBSelect extends Exception { |
|
| 50 | 50 | |
| 51 | 51 | protected $message = 'Unable to select database'; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | # Database charset exception |
| 55 | 55 | |
| 56 | - class DBCharset extends Exception { |
|
| 56 | + class DBCharset extends Exception { |
|
| 57 | 57 | |
| 58 | 58 | protected $message = 'Unable to set database charset'; |
| 59 | 59 | } |
@@ -26,7 +26,9 @@ |
||
| 26 | 26 | |
| 27 | 27 | public function __construct(string $message = '') { |
| 28 | 28 | |
| 29 | - if ('' !== $message) $this->message = $message; |
|
| 29 | + if ('' !== $message) { |
|
| 30 | + $this->message = $message; |
|
| 31 | + } |
|
| 30 | 32 | } |
| 31 | 33 | } |
| 32 | 34 | |
@@ -8,17 +8,29 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | public static function ip() { |
| 10 | 10 | |
| 11 | - if (!empty(getenv('HTTP_CLIENT_IP'))) return getenv('HTTP_CLIENT_IP'); |
|
| 11 | + if (!empty(getenv('HTTP_CLIENT_IP'))) { |
|
| 12 | + return getenv('HTTP_CLIENT_IP'); |
|
| 13 | + } |
|
| 12 | 14 | |
| 13 | - if (!empty(getenv('HTTP_X_FORWARDED_FOR'))) return getenv('HTTP_X_FORWARDED_FOR'); |
|
| 15 | + if (!empty(getenv('HTTP_X_FORWARDED_FOR'))) { |
|
| 16 | + return getenv('HTTP_X_FORWARDED_FOR'); |
|
| 17 | + } |
|
| 14 | 18 | |
| 15 | - if (!empty(getenv('HTTP_X_FORWARDED'))) return getenv('HTTP_X_FORWARDED'); |
|
| 19 | + if (!empty(getenv('HTTP_X_FORWARDED'))) { |
|
| 20 | + return getenv('HTTP_X_FORWARDED'); |
|
| 21 | + } |
|
| 16 | 22 | |
| 17 | - if (!empty(getenv('HTTP_FORWARDED_FOR'))) return getenv('HTTP_FORWARDED_FOR'); |
|
| 23 | + if (!empty(getenv('HTTP_FORWARDED_FOR'))) { |
|
| 24 | + return getenv('HTTP_FORWARDED_FOR'); |
|
| 25 | + } |
|
| 18 | 26 | |
| 19 | - if (!empty(getenv('HTTP_FORWARDED'))) return getenv('HTTP_FORWARDED'); |
|
| 27 | + if (!empty(getenv('HTTP_FORWARDED'))) { |
|
| 28 | + return getenv('HTTP_FORWARDED'); |
|
| 29 | + } |
|
| 20 | 30 | |
| 21 | - if (!empty(getenv('REMOTE_ADDR'))) return getenv('REMOTE_ADDR'); |
|
| 31 | + if (!empty(getenv('REMOTE_ADDR'))) { |
|
| 32 | + return getenv('REMOTE_ADDR'); |
|
| 33 | + } |
|
| 22 | 34 | |
| 23 | 35 | # ------------------------ |
| 24 | 36 | |
@@ -50,9 +62,11 @@ discard block |
||
| 50 | 62 | |
| 51 | 63 | $file_name = (DIR_TEMPLATES . 'Exception.tpl'); |
| 52 | 64 | |
| 53 | - if (false === ($contents = @file_get_contents($file_name))) $output = nl2br($exc); |
|
| 54 | - |
|
| 55 | - else $output = $parse_contents($contents); |
|
| 65 | + if (false === ($contents = @file_get_contents($file_name))) { |
|
| 66 | + $output = nl2br($exc); |
|
| 67 | + } else { |
|
| 68 | + $output = $parse_contents($contents); |
|
| 69 | + } |
|
| 56 | 70 | |
| 57 | 71 | # Set headers |
| 58 | 72 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | # Load template |
| 50 | 50 | |
| 51 | - $file_name = (DIR_TEMPLATES . 'Exception.tpl'); |
|
| 51 | + $file_name = (DIR_TEMPLATES.'Exception.tpl'); |
|
| 52 | 52 | |
| 53 | 53 | if (false === ($contents = @file_get_contents($file_name))) $output = nl2br($exc); |
| 54 | 54 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | header('Pragma: no-cache'); |
| 66 | 66 | |
| 67 | - header(getenv('SERVER_PROTOCOL') . ' 500 Internal Server Error', true, 500); |
|
| 67 | + header(getenv('SERVER_PROTOCOL').' 500 Internal Server Error', true, 500); |
|
| 68 | 68 | |
| 69 | 69 | header('Content-type: text/html; charset=UTF-8'); |
| 70 | 70 | |
@@ -22,15 +22,19 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | $type = $matches[2][$key]; $name = $matches[3][$key]; $contents = ($matches[4][$key] ?? ''); |
| 24 | 24 | |
| 25 | - if (!preg_match(REGEX_TEMPLATE_ITEM_NAME, $name)) continue; |
|
| 25 | + if (!preg_match(REGEX_TEMPLATE_ITEM_NAME, $name)) { |
|
| 26 | + continue; |
|
| 27 | + } |
|
| 26 | 28 | |
| 27 | 29 | $this->contents = str_replace($match, ('{ ' . $type . ':' . $name . ' / }'), $this->contents); |
| 28 | 30 | |
| 29 | - if ($type === 'block') $this->blocks[$name] = (new Block($contents))->$toggle(); |
|
| 30 | - |
|
| 31 | - else if ($type === 'for') $this->loops[$name] = new Loop($contents); |
|
| 32 | - |
|
| 33 | - else if ($type === 'widget') $this->widgets[] = $name; |
|
| 31 | + if ($type === 'block') { |
|
| 32 | + $this->blocks[$name] = (new Block($contents))->$toggle(); |
|
| 33 | + } else if ($type === 'for') { |
|
| 34 | + $this->loops[$name] = new Loop($contents); |
|
| 35 | + } else if ($type === 'widget') { |
|
| 36 | + $this->widgets[] = $name; |
|
| 37 | + } |
|
| 34 | 38 | } |
| 35 | 39 | } |
| 36 | 40 | |
@@ -48,7 +52,9 @@ discard block |
||
| 48 | 52 | |
| 49 | 53 | foreach ($matches[1] as $index => $name) { |
| 50 | 54 | |
| 51 | - if (!preg_match(REGEX_TEMPLATE_ITEM_NAME, $name)) continue; |
|
| 55 | + if (!preg_match(REGEX_TEMPLATE_ITEM_NAME, $name)) { |
|
| 56 | + continue; |
|
| 57 | + } |
|
| 52 | 58 | |
| 53 | 59 | $elementaries['stack'][$name] = false; |
| 54 | 60 | } |
@@ -68,29 +74,39 @@ discard block |
||
| 68 | 74 | |
| 69 | 75 | public function __clone() { |
| 70 | 76 | |
| 71 | - foreach ($this->blocks as $name => $block) $this->blocks[$name] = clone $block; |
|
| 77 | + foreach ($this->blocks as $name => $block) { |
|
| 78 | + $this->blocks[$name] = clone $block; |
|
| 79 | + } |
|
| 72 | 80 | |
| 73 | - foreach ($this->loops as $name => $loop) $this->loops[$name] = clone $loop; |
|
| 81 | + foreach ($this->loops as $name => $loop) { |
|
| 82 | + $this->loops[$name] = clone $loop; |
|
| 83 | + } |
|
| 74 | 84 | } |
| 75 | 85 | |
| 76 | 86 | # Setter |
| 77 | 87 | |
| 78 | 88 | public function __set(string $name, $value) { |
| 79 | 89 | |
| 80 | - if ($value instanceof Block) $this->block($name, $value); |
|
| 81 | - |
|
| 82 | - else if (is_array($value)) $this->loop($name, $value); |
|
| 83 | - |
|
| 84 | - else if (is_scalar($value)) $this->set($name, $value); |
|
| 90 | + if ($value instanceof Block) { |
|
| 91 | + $this->block($name, $value); |
|
| 92 | + } else if (is_array($value)) { |
|
| 93 | + $this->loop($name, $value); |
|
| 94 | + } else if (is_scalar($value)) { |
|
| 95 | + $this->set($name, $value); |
|
| 96 | + } |
|
| 85 | 97 | } |
| 86 | 98 | |
| 87 | 99 | # Set block |
| 88 | 100 | |
| 89 | 101 | public function block(string $name, Block $block = null) { |
| 90 | 102 | |
| 91 | - if (!isset($this->blocks[$name])) return ((null === $block) ? new Block() : $this); |
|
| 103 | + if (!isset($this->blocks[$name])) { |
|
| 104 | + return ((null === $block) ? new Block() : $this); |
|
| 105 | + } |
|
| 92 | 106 | |
| 93 | - if (null === $block) return $this->blocks[$name]; |
|
| 107 | + if (null === $block) { |
|
| 108 | + return $this->blocks[$name]; |
|
| 109 | + } |
|
| 94 | 110 | |
| 95 | 111 | $this->blocks[$name] = $block; |
| 96 | 112 | |
@@ -103,9 +119,13 @@ discard block |
||
| 103 | 119 | |
| 104 | 120 | public function loop(string $name, array $range = null) { |
| 105 | 121 | |
| 106 | - if (!isset($this->loops[$name])) return ((null === $range) ? new Loop() : $this); |
|
| 122 | + if (!isset($this->loops[$name])) { |
|
| 123 | + return ((null === $range) ? new Loop() : $this); |
|
| 124 | + } |
|
| 107 | 125 | |
| 108 | - if (null === $range) return $this->loops[$name]; |
|
| 126 | + if (null === $range) { |
|
| 127 | + return $this->loops[$name]; |
|
| 128 | + } |
|
| 109 | 129 | |
| 110 | 130 | $this->loops[$name]->range($range); |
| 111 | 131 | |
@@ -118,7 +138,9 @@ discard block |
||
| 118 | 138 | |
| 119 | 139 | public function set(string $name, string $value) { |
| 120 | 140 | |
| 121 | - if (isset($this->variables[$name])) $this->variables[$name] = $value; |
|
| 141 | + if (isset($this->variables[$name])) { |
|
| 142 | + $this->variables[$name] = $value; |
|
| 143 | + } |
|
| 122 | 144 | |
| 123 | 145 | return $this; |
| 124 | 146 | } |
@@ -127,7 +149,9 @@ discard block |
||
| 127 | 149 | |
| 128 | 150 | public function contents() { |
| 129 | 151 | |
| 130 | - if (!$this->enabled) return ''; |
|
| 152 | + if (!$this->enabled) { |
|
| 153 | + return ''; |
|
| 154 | + } |
|
| 131 | 155 | |
| 132 | 156 | $this->enabled = false; $insertions = []; |
| 133 | 157 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | if (!preg_match(REGEX_TEMPLATE_ITEM_NAME, $name)) continue; |
| 26 | 26 | |
| 27 | - $this->contents = str_replace($match, ('{ ' . $type . ':' . $name . ' / }'), $this->contents); |
|
| 27 | + $this->contents = str_replace($match, ('{ '.$type.':'.$name.' / }'), $this->contents); |
|
| 28 | 28 | |
| 29 | 29 | if ($type === 'block') $this->blocks[$name] = (new Block($contents))->$toggle(); |
| 30 | 30 | |
@@ -135,14 +135,14 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | foreach ($this->blocks as $name => $block) { |
| 137 | 137 | |
| 138 | - $insertions['{ block:' . $name . ' / }'] = $block->contents(); |
|
| 138 | + $insertions['{ block:'.$name.' / }'] = $block->contents(); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | # Process loops |
| 142 | 142 | |
| 143 | 143 | foreach ($this->loops as $name => $loop) { |
| 144 | 144 | |
| 145 | - $insertions['{ for:' . $name . ' / }'] = $loop->contents(); |
|
| 145 | + $insertions['{ for:'.$name.' / }'] = $loop->contents(); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | # Process widgets |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | $contents = ((false !== $widget) ? $widget->contents() : ''); |
| 155 | 155 | |
| 156 | - $insertions['{ widget:' . $name . ' / }'] = $contents; |
|
| 156 | + $insertions['{ widget:'.$name.' / }'] = $contents; |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | # Process variables |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | $value = ((false === $value) ? Template::global($name) : $value); |
| 164 | 164 | |
| 165 | - $insertions['$' . $name . '$'] = Str::output($value); |
|
| 165 | + $insertions['$'.$name.'$'] = Str::output($value); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | # Process phrases |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | $value = Language::get($name); |
| 173 | 173 | |
| 174 | - $insertions['%' . $name . '%'] = Str::output($value); |
|
| 174 | + $insertions['%'.$name.'%'] = Str::output($value); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | # Unlock and process insertions |
@@ -2,7 +2,13 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Modules\Auth\Utils { |
| 4 | 4 | |
| 5 | - use Modules\Auth, Modules\Entitizer, Modules\Settings, Utils\View, Date, Language, Mailer; |
|
| 5 | + use Modules\Auth; |
|
| 6 | + use Modules\Entitizer; |
|
| 7 | + use Modules\Settings; |
|
| 8 | + use Utils\View; |
|
| 9 | + use Date; |
|
| 10 | + use Language; |
|
| 11 | + use Mailer; |
|
| 6 | 12 | |
| 7 | 13 | abstract class Mail { |
| 8 | 14 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | $to = $user->email; $sender = Settings::get('site_title'); $reply_to = Settings::get('system_email'); |
| 20 | 20 | |
| 21 | - $from = ((false !== ($host = parse_url(Settings::get('system_url'), PHP_URL_HOST))) ? ('noreply@' . $host) : ''); |
|
| 21 | + $from = ((false !== ($host = parse_url(Settings::get('system_url'), PHP_URL_HOST))) ? ('noreply@'.$host) : ''); |
|
| 22 | 22 | |
| 23 | 23 | return Mailer::send($to, $sender, $from, $reply_to, $subject, $message->contents(true), true); |
| 24 | 24 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | public static function reset(Entitizer\Entity\User $user, string $code) { |
| 29 | 29 | |
| 30 | - $link = (Settings::get('system_url') . (Auth::admin() ? '/admin' : '/profile') . '/recover?code=' . $code); |
|
| 30 | + $link = (Settings::get('system_url').(Auth::admin() ? '/admin' : '/profile').'/recover?code='.$code); |
|
| 31 | 31 | |
| 32 | 32 | return self::send($user, 'Blocks\Auth\Mail\Reset', Language::get('MAIL_SUBJECT_RESET'), $link); |
| 33 | 33 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | public static function register(Entitizer\Entity\User $user) { |
| 38 | 38 | |
| 39 | - $link = (Settings::get('system_url') . (Auth::admin() ? '/admin' : '/profile')); |
|
| 39 | + $link = (Settings::get('system_url').(Auth::admin() ? '/admin' : '/profile')); |
|
| 40 | 40 | |
| 41 | 41 | return self::send($user, 'Blocks\Auth\Mail\Register', Language::get('MAIL_SUBJECT_REGISTER'), $link); |
| 42 | 42 | } |
@@ -2,7 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Modules\Entitizer\Form { |
| 4 | 4 | |
| 5 | - use Modules\Entitizer, Utils\Form; |
|
| 5 | + use Modules\Entitizer; |
|
| 6 | + use Utils\Form; |
|
| 6 | 7 | |
| 7 | 8 | class Widget extends Form { |
| 8 | 9 | |
@@ -2,7 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Modules\Filemanager\Handler { |
| 4 | 4 | |
| 5 | - use Modules\Filemanager, Date, Template; |
|
| 5 | + use Modules\Filemanager; |
|
| 6 | + use Date; |
|
| 7 | + use Template; |
|
| 6 | 8 | |
| 7 | 9 | class Dir extends Filemanager\Utils\Handler { |
| 8 | 10 | |