Completed
Branch 0.3.0 (b16461)
by Anton
04:03
created
www/engine/System/Includes/Config.php 1 patch
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -2,126 +2,126 @@
 block discarded – undo
2 2
 
3 3
 # Admin ip
4 4
 
5
-define('CONFIG_ADMIN_IP',                           '');
5
+define('CONFIG_ADMIN_IP', '');
6 6
 
7 7
 # Session
8 8
 
9
-define('CONFIG_SESSION_NAME',                       '_sessid');
10
-define('CONFIG_SESSION_LIFETIME',                   2592000);       # 30 days
9
+define('CONFIG_SESSION_NAME', '_sessid');
10
+define('CONFIG_SESSION_LIFETIME', 2592000); # 30 days
11 11
 
12 12
 # Language
13 13
 
14
-define('CONFIG_LANGUAGE_COOKIE_EXPIRES',            30758400);      # 356 days
14
+define('CONFIG_LANGUAGE_COOKIE_EXPIRES', 30758400); # 356 days
15 15
 
16 16
 # Template
17 17
 
18
-define('CONFIG_TEMPLATE_COOKIE_EXPIRES',            30758400);      # 356 days
18
+define('CONFIG_TEMPLATE_COOKIE_EXPIRES', 30758400); # 356 days
19 19
 
20 20
 # Entitizer
21 21
 
22
-define('CONFIG_ENTITIZER_MAX_DEPTH',                6);
22
+define('CONFIG_ENTITIZER_MAX_DEPTH', 6);
23 23
 
24 24
 # Page
25 25
 
26
-define('CONFIG_PAGE_TITLE_MAX_LENGTH',              255);
27
-define('CONFIG_PAGE_NAME_MAX_LENGTH',               40);
28
-define('CONFIG_PAGE_DESCRIPTION_MAX_LENGTH',        512);
29
-define('CONFIG_PAGE_KEYWORDS_MAX_LENGTH',           512);
26
+define('CONFIG_PAGE_TITLE_MAX_LENGTH', 255);
27
+define('CONFIG_PAGE_NAME_MAX_LENGTH', 40);
28
+define('CONFIG_PAGE_DESCRIPTION_MAX_LENGTH', 512);
29
+define('CONFIG_PAGE_KEYWORDS_MAX_LENGTH', 512);
30 30
 
31 31
 # Menuitem
32 32
 
33
-define('CONFIG_MENUITEM_TEXT_MAX_LENGTH',           255);
34
-define('CONFIG_MENUITEM_SLUG_MAX_LENGTH',           255);
35
-define('CONFIG_MENUITEM_POSITION_MAX_LENGTH',       2);
33
+define('CONFIG_MENUITEM_TEXT_MAX_LENGTH', 255);
34
+define('CONFIG_MENUITEM_SLUG_MAX_LENGTH', 255);
35
+define('CONFIG_MENUITEM_POSITION_MAX_LENGTH', 2);
36 36
 
37 37
 # Variables
38 38
 
39
-define('CONFIG_VARIABLE_TITLE_MAX_LENGTH',          64);
40
-define('CONFIG_VARIABLE_NAME_MAX_LENGTH',           32);
41
-define('CONFIG_VARIABLE_VALUE_MAX_LENGTH',          255);
39
+define('CONFIG_VARIABLE_TITLE_MAX_LENGTH', 64);
40
+define('CONFIG_VARIABLE_NAME_MAX_LENGTH', 32);
41
+define('CONFIG_VARIABLE_VALUE_MAX_LENGTH', 255);
42 42
 
43 43
 # Widgets
44 44
 
45
-define('CONFIG_WIDGET_TITLE_MAX_LENGTH',            64);
46
-define('CONFIG_WIDGET_NAME_MAX_LENGTH',             32);
45
+define('CONFIG_WIDGET_TITLE_MAX_LENGTH', 64);
46
+define('CONFIG_WIDGET_NAME_MAX_LENGTH', 32);
47 47
 
48 48
 # Filemanager
49 49
 
50
-define('CONFIG_FILEMANAGER_NAME_MAX_LENGTH',        128);
50
+define('CONFIG_FILEMANAGER_NAME_MAX_LENGTH', 128);
51 51
 
52 52
 # User
53 53
 
54
-define('CONFIG_USER_SESSION_LIFETIME',              604800);        # 7 days
55
-define('CONFIG_USER_SECRET_LIFETIME',               86400);         # 1 day
54
+define('CONFIG_USER_SESSION_LIFETIME', 604800); # 7 days
55
+define('CONFIG_USER_SECRET_LIFETIME', 86400); # 1 day
56 56
 
57
-define('CONFIG_USER_NAME_MIN_LENGTH',               4);
58
-define('CONFIG_USER_NAME_MAX_LENGTH',               16);
57
+define('CONFIG_USER_NAME_MIN_LENGTH', 4);
58
+define('CONFIG_USER_NAME_MAX_LENGTH', 16);
59 59
 
60
-define('CONFIG_USER_PASSWORD_MIN_LENGTH',           4);
61
-define('CONFIG_USER_PASSWORD_MAX_LENGTH',           32);
60
+define('CONFIG_USER_PASSWORD_MIN_LENGTH', 4);
61
+define('CONFIG_USER_PASSWORD_MAX_LENGTH', 32);
62 62
 
63
-define('CONFIG_USER_EMAIL_MAX_LENGTH',              128);
63
+define('CONFIG_USER_EMAIL_MAX_LENGTH', 128);
64 64
 
65
-define('CONFIG_USER_FIRST_NAME_MAX_LENGTH',         32);
66
-define('CONFIG_USER_LAST_NAME_MAX_LENGTH',          32);
65
+define('CONFIG_USER_FIRST_NAME_MAX_LENGTH', 32);
66
+define('CONFIG_USER_LAST_NAME_MAX_LENGTH', 32);
67 67
 
68
-define('CONFIG_USER_CITY_MAX_LENGTH',               32);
68
+define('CONFIG_USER_CITY_MAX_LENGTH', 32);
69 69
 
70
-define('CONFIG_USER_CAPTCHA_MAX_LENGTH',            16);
70
+define('CONFIG_USER_CAPTCHA_MAX_LENGTH', 16);
71 71
 
72 72
 # Captcha
73 73
 
74
-define('CONFIG_CAPTCHA_LENGTH',                     5);
74
+define('CONFIG_CAPTCHA_LENGTH', 5);
75 75
 
76
-define('CONFIG_CAPTCHA_WIDTH',                      150);
77
-define('CONFIG_CAPTCHA_HEIGHT',                     40);
76
+define('CONFIG_CAPTCHA_WIDTH', 150);
77
+define('CONFIG_CAPTCHA_HEIGHT', 40);
78 78
 
79
-define('CONFIG_CAPTCHA_FONT',                       'Fonts/airstrip.ttf');
80
-define('CONFIG_CAPTCHA_FONT_SIZE',                  20);
79
+define('CONFIG_CAPTCHA_FONT', 'Fonts/airstrip.ttf');
80
+define('CONFIG_CAPTCHA_FONT_SIZE', 20);
81 81
 
82
-define('CONFIG_CAPTCHA_TEXT_INDENT',                15);
83
-define('CONFIG_CAPTCHA_TEXT_STEP',                  25);
82
+define('CONFIG_CAPTCHA_TEXT_INDENT', 15);
83
+define('CONFIG_CAPTCHA_TEXT_STEP', 25);
84 84
 
85 85
 # Admin
86 86
 
87
-define('CONFIG_ADMIN_LANGUAGE_DEFAULT',             'en-US');
88
-define('CONFIG_ADMIN_TEMPLATE_DEFAULT',             'Default');
87
+define('CONFIG_ADMIN_LANGUAGE_DEFAULT', 'en-US');
88
+define('CONFIG_ADMIN_TEMPLATE_DEFAULT', 'Default');
89 89
 
90
-define('CONFIG_ADMIN_PAGES_DISPLAY',                50);
91
-define('CONFIG_ADMIN_MENUITEMS_DISPLAY',            50);
92
-define('CONFIG_ADMIN_VARIABLES_DISPLAY',            50);
93
-define('CONFIG_ADMIN_WIDGETS_DISPLAY',              50);
94
-define('CONFIG_ADMIN_USERS_DISPLAY',                50);
90
+define('CONFIG_ADMIN_PAGES_DISPLAY', 50);
91
+define('CONFIG_ADMIN_MENUITEMS_DISPLAY', 50);
92
+define('CONFIG_ADMIN_VARIABLES_DISPLAY', 50);
93
+define('CONFIG_ADMIN_WIDGETS_DISPLAY', 50);
94
+define('CONFIG_ADMIN_USERS_DISPLAY', 50);
95 95
 
96
-define('CONFIG_ADMIN_FILEMANAGER_ITEMS_DISPLAY',    50);
96
+define('CONFIG_ADMIN_FILEMANAGER_ITEMS_DISPLAY', 50);
97 97
 
98 98
 # Site
99 99
 
100
-define('CONFIG_SITE_LANGUAGE_DEFAULT',              'en-US');
101
-define('CONFIG_SITE_TEMPLATE_DEFAULT',              'Default');
100
+define('CONFIG_SITE_LANGUAGE_DEFAULT', 'en-US');
101
+define('CONFIG_SITE_TEMPLATE_DEFAULT', 'Default');
102 102
 
103
-define('CONFIG_SITE_TITLE_DEFAULT',                 'Demo Site');
104
-define('CONFIG_SITE_SLOGAN_DEFAULT',                'A place for site slogan');
103
+define('CONFIG_SITE_TITLE_DEFAULT', 'Demo Site');
104
+define('CONFIG_SITE_SLOGAN_DEFAULT', 'A place for site slogan');
105 105
 
106
-define('CONFIG_SITE_TITLE_MAX_LENGTH',              128);
107
-define('CONFIG_SITE_SLOGAN_MAX_LENGTH',             255);
108
-define('CONFIG_SITE_DESCRIPTION_MAX_LENGTH',        512);
109
-define('CONFIG_SITE_KEYWORDS_MAX_LENGTH',           512);
106
+define('CONFIG_SITE_TITLE_MAX_LENGTH', 128);
107
+define('CONFIG_SITE_SLOGAN_MAX_LENGTH', 255);
108
+define('CONFIG_SITE_DESCRIPTION_MAX_LENGTH', 512);
109
+define('CONFIG_SITE_KEYWORDS_MAX_LENGTH', 512);
110 110
 
111 111
 # System
112 112
 
113
-define('CONFIG_SYSTEM_URL_MAX_LENGTH',              128);
114
-define('CONFIG_SYSTEM_EMAIL_MAX_LENGTH',            128);
113
+define('CONFIG_SYSTEM_URL_MAX_LENGTH', 128);
114
+define('CONFIG_SYSTEM_EMAIL_MAX_LENGTH', 128);
115 115
 
116
-define('CONFIG_SYSTEM_TIMEZONE_DEFAULT',            'UTC');
116
+define('CONFIG_SYSTEM_TIMEZONE_DEFAULT', 'UTC');
117 117
 
118 118
 # Database
119 119
 
120
-define('CONFIG_DATABASE_SERVER_MAX_LENGTH',         128);
121
-define('CONFIG_DATABASE_USER_MAX_LENGTH',           64);
122
-define('CONFIG_DATABASE_PASSWORD_MAX_LENGTH',       64);
123
-define('CONFIG_DATABASE_NAME_MAX_LENGTH',           64);
120
+define('CONFIG_DATABASE_SERVER_MAX_LENGTH', 128);
121
+define('CONFIG_DATABASE_USER_MAX_LENGTH', 64);
122
+define('CONFIG_DATABASE_PASSWORD_MAX_LENGTH', 64);
123
+define('CONFIG_DATABASE_NAME_MAX_LENGTH', 64);
124 124
 
125 125
 # Other
126 126
 
127
-define('CONFIG_UPLOADS_MAX_SIZE',                   104857600);  # 100 MB
127
+define('CONFIG_UPLOADS_MAX_SIZE', 104857600); # 100 MB
Please login to merge, or discard this patch.
www/engine/System/Classes/Utils/Menu.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,9 @@  discard block
 block discarded – undo
20 20
 
21 21
 				$item->children = ($children = Template::group());
22 22
 
23
-				foreach ($this->menu[$id]['children'] as $child) $children->add($this->parseItem($child));
23
+				foreach ($this->menu[$id]['children'] as $child) {
24
+					$children->add($this->parseItem($child));
25
+				}
24 26
 
25 27
 			} else {
26 28
 
@@ -44,7 +46,9 @@  discard block
 block discarded – undo
44 46
 
45 47
 			$menu = Entitizer::treeview(TABLE_MENU)->subtree(0, ['active' => true]);
46 48
 
47
-			if (false !== $menu) $this->menu = $menu;
49
+			if (false !== $menu) {
50
+				$this->menu = $menu;
51
+			}
48 52
 		}
49 53
 
50 54
 		# Get block
@@ -53,7 +57,9 @@  discard block
 block discarded – undo
53 57
 
54 58
 			$menu = Template::group();
55 59
 
56
-			foreach ($this->menu[0]['children'] as $id) $menu->add($this->parseItem($id));
60
+			foreach ($this->menu[0]['children'] as $id) {
61
+				$menu->add($this->parseItem($id));
62
+			}
57 63
 
58 64
 			# ------------------------
59 65
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Utils/Messages.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,9 @@  discard block
 block discarded – undo
21 21
 
22 22
 		public static function set(string $type, string $text, string $title = null) {
23 23
 
24
-			if (!in_array($type, static::$types, true) || isset(static::$items[$type]) || ('' === $text)) return;
24
+			if (!in_array($type, static::$types, true) || isset(static::$items[$type]) || ('' === $text)) {
25
+				return;
26
+			}
25 27
 
26 28
 			static::$items[$type] = ['text' => $text, 'title' => (('' !== $title) ? $title : null)];
27 29
 		}
@@ -45,7 +47,9 @@  discard block
 block discarded – undo
45 47
 
46 48
 				$block->type = $type; $block->text = Template::block($item['text']);
47 49
 
48
-				if (isset($item['title'])) $block->block('title')->set('text', $item['title'])->enable();
50
+				if (isset($item['title'])) {
51
+					$block->block('title')->set('text', $item['title'])->enable();
52
+				}
49 53
 			}
50 54
 
51 55
 			# ------------------------
Please login to merge, or discard this patch.
www/engine/System/Classes/Utils/Template/Variables.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,11 +14,15 @@
 block discarded – undo
14 14
 
15 15
 			$selection = ['name', 'value']; $order = ['name' => 'ASC'];
16 16
 
17
-			if (!(DB::select(TABLE_VARIABLES, $selection, null, $order) && DB::last()->status)) return;
17
+			if (!(DB::select(TABLE_VARIABLES, $selection, null, $order) && DB::last()->status)) {
18
+				return;
19
+			}
18 20
 
19 21
 			# Process results
20 22
 
21
-			while (null !== ($variable = DB::last()->row())) yield $variable['name'] => $variable['value'];
23
+			while (null !== ($variable = DB::last()->row())) {
24
+				yield $variable['name'] => $variable['value'];
25
+			}
22 26
 		}
23 27
 	}
24 28
 }
Please login to merge, or discard this patch.
www/engine/System/Classes/Utils/Template/Widgets.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,11 +14,15 @@
 block discarded – undo
14 14
 
15 15
 			$selection = ['name', 'contents']; $condition = ['active' => 1]; $order = ['name' => 'ASC'];
16 16
 
17
-			if (!(DB::select(TABLE_WIDGETS, $selection, $condition, $order) && DB::last()->status)) return;
17
+			if (!(DB::select(TABLE_WIDGETS, $selection, $condition, $order) && DB::last()->status)) {
18
+				return;
19
+			}
18 20
 
19 21
 			# Process results
20 22
 
21
-			while (null !== ($widget = DB::last()->row())) yield $widget['name'] => Template::block($widget['contents']);
23
+			while (null !== ($widget = DB::last()->row())) {
24
+				yield $widget['name'] => Template::block($widget['contents']);
25
+			}
22 26
 		}
23 27
 	}
24 28
 }
Please login to merge, or discard this patch.
www/engine/System/Classes/Utils/Pagination.php 1 patch
Braces   +15 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,7 +14,9 @@  discard block
 block discarded – undo
14 14
 
15 15
 			for ($index = ($active - 2); $index <= ($active + 2); $index++) {
16 16
 
17
-				if (!($index > 0 && $index <= $count)) continue;
17
+				if (!($index > 0 && $index <= $count)) {
18
+					continue;
19
+				}
18 20
 
19 21
 				$class = (($index === $active) ? 'active item' : 'item');
20 22
 
@@ -41,7 +43,9 @@  discard block
 block discarded – undo
41 43
 
42 44
 				$block->link = $url->set('index', $index)->string(); $block->index = $index;
43 45
 
44
-				if ($closest) $block->block('ellipsis')->disable();
46
+				if ($closest) {
47
+					$block->block('ellipsis')->disable();
48
+				}
45 49
 			}
46 50
 		}
47 51
 
@@ -58,9 +62,9 @@  discard block
 block discarded – undo
58 62
 
59 63
 				list ($extremum, $index) = $data; $block = $pagination->block($class);
60 64
 
61
-				if ($active === $extremum) { $block->disable(); $pagination->block($class . '_disabled')->enable(); }
62
-
63
-				else $block->link = $url->set('index', $index)->string();
65
+				if ($active === $extremum) { $block->disable(); $pagination->block($class . '_disabled')->enable(); } else {
66
+					$block->link = $url->set('index', $index)->string();
67
+				}
64 68
 			}
65 69
 		}
66 70
 
@@ -68,9 +72,13 @@  discard block
 block discarded – undo
68 72
 
69 73
 		public static function block(int $index, int $display, int $total, Url $url) {
70 74
 
71
-			if (($index <= 0) || ($display <= 0) || ($total <= 0)) return false;
75
+			if (($index <= 0) || ($display <= 0) || ($total <= 0)) {
76
+				return false;
77
+			}
72 78
 
73
-			if (($display >= $total) || ($index > ($count = ceil($total / $display)))) return false;
79
+			if (($display >= $total) || ($index > ($count = ceil($total / $display)))) {
80
+				return false;
81
+			}
74 82
 
75 83
 			# Create block
76 84
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Utils/Form.php 1 patch
Braces   +14 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,11 @@  discard block
 block discarded – undo
12 12
 
13 13
 			$text = Language::get($code);
14 14
 
15
-			if (!$popup) Messages::set('error', $text); else Popup::set('negative', $text);
15
+			if (!$popup) {
16
+				Messages::set('error', $text);
17
+			} else {
18
+				Popup::set('negative', $text);
19
+			}
16 20
 
17 21
 			# ------------------------
18 22
 
@@ -23,15 +27,21 @@  discard block
 block discarded – undo
23 27
 
24 28
 		public function handle(callable $callback, bool $popup = false) {
25 29
 
26
-			if (false === ($post = $this->post())) return false;
30
+			if (false === ($post = $this->post())) {
31
+				return false;
32
+			}
27 33
 
28 34
 			# Check form for errors
29 35
 
30
-			if ($this->errors()) return $this->displayError('FORM_ERROR_REQUIRED', $popup);
36
+			if ($this->errors()) {
37
+				return $this->displayError('FORM_ERROR_REQUIRED', $popup);
38
+			}
31 39
 
32 40
 			# Call controller method
33 41
 
34
-			if (is_string($result = $callback($post))) return $this->displayError($result, $popup);
42
+			if (is_string($result = $callback($post))) {
43
+				return $this->displayError($result, $popup);
44
+			}
35 45
 
36 46
 			if (is_array($result)) { $this->get($result[0])->error(true); return $this->displayError($result[1], $popup); }
37 47
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Utils/Uploader.php 1 patch
Braces   +45 added lines, -15 removed lines patch added patch discarded remove patch
@@ -10,19 +10,33 @@  discard block
 block discarded – undo
10 10
 
11 11
 		private static function translateError(int $error) {
12 12
 
13
-			if ($error === UPLOAD_ERR_INI_SIZE)         return 'UPLOADER_ERROR_INI_SIZE';
13
+			if ($error === UPLOAD_ERR_INI_SIZE) {
14
+				return 'UPLOADER_ERROR_INI_SIZE';
15
+			}
14 16
 
15
-			if ($error === UPLOAD_ERR_FORM_SIZE)        return 'UPLOADER_ERROR_FORM_SIZE';
17
+			if ($error === UPLOAD_ERR_FORM_SIZE) {
18
+				return 'UPLOADER_ERROR_FORM_SIZE';
19
+			}
16 20
 
17
-			if ($error === UPLOAD_ERR_PARTIAL)          return 'UPLOADER_ERROR_PARTIAL';
21
+			if ($error === UPLOAD_ERR_PARTIAL) {
22
+				return 'UPLOADER_ERROR_PARTIAL';
23
+			}
18 24
 
19
-			if ($error === UPLOAD_ERR_NO_FILE)          return 'UPLOADER_ERROR_NO_FILE';
25
+			if ($error === UPLOAD_ERR_NO_FILE) {
26
+				return 'UPLOADER_ERROR_NO_FILE';
27
+			}
20 28
 
21
-			if ($error === UPLOAD_ERR_NO_TMP_DIR)       return 'UPLOADER_ERROR_NO_TMP_DIR';
29
+			if ($error === UPLOAD_ERR_NO_TMP_DIR) {
30
+				return 'UPLOADER_ERROR_NO_TMP_DIR';
31
+			}
22 32
 
23
-			if ($error === UPLOAD_ERR_CANT_WRITE)       return 'UPLOADER_ERROR_CANT_WRITE';
33
+			if ($error === UPLOAD_ERR_CANT_WRITE) {
34
+				return 'UPLOADER_ERROR_CANT_WRITE';
35
+			}
24 36
 
25
-			if ($error === UPLOAD_ERR_EXTENSION)        return 'UPLOADER_ERROR_EXTENSION';
37
+			if ($error === UPLOAD_ERR_EXTENSION) {
38
+				return 'UPLOADER_ERROR_EXTENSION';
39
+			}
26 40
 
27 41
 			# ------------------------
28 42
 
@@ -33,19 +47,27 @@  discard block
 block discarded – undo
33 47
 
34 48
 		public static function save(string $name, string $dir_name) {
35 49
 
36
-			if ((false === ($file = Request::file($name))) || !is_uploaded_file($file['tmp_name'])) return false;
50
+			if ((false === ($file = Request::file($name))) || !is_uploaded_file($file['tmp_name'])) {
51
+				return false;
52
+			}
37 53
 
38 54
 			# Check for demo mode
39 55
 
40
-			if (Informer::isDemoMode()) return 'DEMO_MODE_RESTRICTION';
56
+			if (Informer::isDemoMode()) {
57
+				return 'DEMO_MODE_RESTRICTION';
58
+			}
41 59
 
42 60
 			# Check for upload errors
43 61
 
44
-			if ($file['error'] !== UPLOAD_ERR_OK) return self::translateError($file['error']);
62
+			if ($file['error'] !== UPLOAD_ERR_OK) {
63
+				return self::translateError($file['error']);
64
+			}
45 65
 
46 66
 			# Check size
47 67
 
48
-			if ($file['size'] > CONFIG_UPLOADS_MAX_SIZE) return 'UPLOADER_ERROR_SIZE';
68
+			if ($file['size'] > CONFIG_UPLOADS_MAX_SIZE) {
69
+				return 'UPLOADER_ERROR_SIZE';
70
+			}
49 71
 
50 72
 			# Check file extension
51 73
 
@@ -53,21 +75,29 @@  discard block
 block discarded – undo
53 75
 
54 76
 			$extension = strtolower(Explorer::extension($file['name'], false));
55 77
 
56
-			if (in_array($extension, $extensions, true)) return 'UPLOADER_ERROR_TYPE';
78
+			if (in_array($extension, $extensions, true)) {
79
+				return 'UPLOADER_ERROR_TYPE';
80
+			}
57 81
 
58 82
 			# Check target directory
59 83
 
60
-			if (!Explorer::isDir($dir_name)) return 'UPLOADER_ERROR_DIR';
84
+			if (!Explorer::isDir($dir_name)) {
85
+				return 'UPLOADER_ERROR_DIR';
86
+			}
61 87
 
62 88
 			# Check target file
63 89
 
64 90
 			$file_name = ($dir_name . '/' . basename($file['name']));
65 91
 
66
-			if (Explorer::isDir($file_name) || Explorer::isFile($file_name)) return 'UPLOADER_ERROR_EXISTS';
92
+			if (Explorer::isDir($file_name) || Explorer::isFile($file_name)) {
93
+				return 'UPLOADER_ERROR_EXISTS';
94
+			}
67 95
 
68 96
 			# Save uploaded file
69 97
 
70
-			if (!@move_uploaded_file($file['tmp_name'], $file_name)) return 'UPLOADER_ERROR_SAVE';
98
+			if (!@move_uploaded_file($file['tmp_name'], $file_name)) {
99
+				return 'UPLOADER_ERROR_SAVE';
100
+			}
71 101
 
72 102
 			# ------------------------
73 103
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Auth/Controller/Recover.php 1 patch
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@  discard block
 block discarded – undo
10 10
 
11 11
 		public function __invoke(array $post) {
12 12
 
13
-			if (!Auth::check()) return false;
13
+			if (!Auth::check()) {
14
+				return false;
15
+			}
14 16
 
15 17
 			# Declare variables
16 18
 
@@ -22,13 +24,15 @@  discard block
 block discarded – undo
22 24
 
23 25
 			# Validate values
24 26
 
25
-			if (false === ($password_new = Validate::userPassword($password_new)))
26
-
27
+			if (false === ($password_new = Validate::userPassword($password_new))) {
28
+			
27 29
 				return ['password_new', 'USER_ERROR_PASSWORD_NEW_INVALID'];
30
+			}
28 31
 
29
-			if (0 !== strcmp($password_new, $password_retype))
30
-
32
+			if (0 !== strcmp($password_new, $password_retype)) {
33
+			
31 34
 				return ['password_retype', 'USER_ERROR_PASSWORD_MISMATCH'];
35
+			}
32 36
 
33 37
 			# Encode password
34 38
 
@@ -38,7 +42,9 @@  discard block
 block discarded – undo
38 42
 
39 43
 			$data = ['auth_key' => $auth_key, 'password' => $password];
40 44
 
41
-			if (!Auth::user()->edit($data)) return 'USER_ERROR_AUTH_RECOVER';
45
+			if (!Auth::user()->edit($data)) {
46
+				return 'USER_ERROR_AUTH_RECOVER';
47
+			}
42 48
 
43 49
 			# Remove secret
44 50
 
Please login to merge, or discard this patch.