Completed
Branch master (e5db64)
by Schlaefer
09:02
created
app/Controller/AppController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
 			// activate stopwatch in debug mode
138 138
 			$this->set('showStopwatchOutput', false);
139
-			if ((int)Configure::read('debug') > 0) {
139
+			if ((int) Configure::read('debug') > 0) {
140 140
 				$this->set('showStopwatchOutput', true);
141 141
 			};
142 142
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
 			$this->set('lastAction', $this->localReferer('action'));
185 185
 			$this->set('lastController', $this->localReferer('controller'));
186
-			$this->set('isDebug', (int)Configure::read('debug') > 0);
186
+			$this->set('isDebug', (int) Configure::read('debug') > 0);
187 187
 			$this->_setLayoutTitles();
188 188
 
189 189
 			$this->_setXFrameOptionsHeader();
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 			} else {
289 289
 				$_pageTitle = __d(
290 290
 					'page_titles',
291
-						$this->params['controller'] . '/' . $this->params['action']
291
+						$this->params['controller'].'/'.$this->params['action']
292 292
 				);
293 293
 			}
294 294
 			$this->set('title_for_page', $_pageTitle);
@@ -449,9 +449,9 @@  discard block
 block discarded – undo
449 449
 		 */
450 450
 		protected function _l10nRenderFile() {
451 451
 			$locale = Configure::read('Config.language');
452
-			$l10nViewPath = $this->viewPath . DS . $locale;
453
-			$l10nViewFile = $l10nViewPath . DS . $this->view . '.ctp';
454
-			if ($locale && file_exists(APP . 'View' . DS . $l10nViewFile)
452
+			$l10nViewPath = $this->viewPath.DS.$locale;
453
+			$l10nViewFile = $l10nViewPath.DS.$this->view.'.ctp';
454
+			if ($locale && file_exists(APP.'View'.DS.$l10nViewFile)
455 455
 			) {
456 456
 				$this->viewPath = $l10nViewPath;
457 457
 			}
Please login to merge, or discard this patch.
app/Controller/Component/SaitoEmailComponent.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 				}
69 69
 			}
70 70
 
71
-			$this->_emailConfigExists = file_exists(APP . 'Config' . DS . 'email' . '.php');
71
+			$this->_emailConfigExists = file_exists(APP.'Config'.DS.'email'.'.php');
72 72
 
73 73
 			$this->_forumName = Configure::read('Saito.Settings.forum_name');
74 74
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 		protected function _config($params = []) {
113 113
 			$defaults = [
114 114
 				'viewVars' => [
115
-					'webroot' => Router::fullBaseUrl() . $this->_webroot,
115
+					'webroot' => Router::fullBaseUrl().$this->_webroot,
116 116
 				],
117 117
 			];
118 118
 			$params = array_merge_recursive($defaults, $params);
Please login to merge, or discard this patch.
app/Controller/Component/ThemesComponent.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@
 block discarded – undo
130 130
 		 * @return array with Theme names
131 131
 		 */
132 132
 		public function themeDirs() {
133
-			$_ThemeDir = new Folder(App::paths()['View'][0] . 'Themed');
133
+			$_ThemeDir = new Folder(App::paths()['View'][0].'Themed');
134 134
 			return $_ThemeDir->read()[0];
135 135
 		}
136 136
 
Please login to merge, or discard this patch.
app/Controller/Component/Auth/Mlf2PasswordHasher.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 		public function hash($password) {
11 11
 			// compare to includes/functions.inc.php generate_pw_hash() mlf 2.3
12 12
 			$salt = self::_generateRandomString(10);
13
-			$saltedHash = sha1($password . $salt);
14
-			$hashWithSalt = $saltedHash . $salt;
13
+			$saltedHash = sha1($password.$salt);
14
+			$hashWithSalt = $saltedHash.$salt;
15 15
 			return $hashWithSalt;
16 16
 		}
17 17
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 			// compare to includes/functions.inc.php is_pw_correct() mlf 2.3
29 29
 			$saltedHash = substr($hash, 0, 40);
30 30
 			$salt = substr($hash, 40, 10);
31
-			if (sha1($password . $salt) == $saltedHash) :
31
+			if (sha1($password.$salt) == $saltedHash) :
32 32
 				$out = true;
33 33
 			endif;
34 34
 			return $out;
Please login to merge, or discard this patch.
app/Controller/Component/ShoutsComponent.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
 		public function startup(Controller $controller) {
14 14
 			$this->_Controller = $controller;
15
-			$this->settings['maxNumberOfShouts'] = (int)Configure::read(
15
+			$this->settings['maxNumberOfShouts'] = (int) Configure::read(
16 16
 				'Saito.Settings.shoutbox_max_shouts');
17 17
 		}
18 18
 
Please login to merge, or discard this patch.
app/Controller/Component/EmailNotificationComponent.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 				$event->data['subject'],
22 22
 				'EmailNotification');
23 23
 			if ($recipients):
24
-				$method = '_' . $this->_handledEvents[$event->name()];
24
+				$method = '_'.$this->_handledEvents[$event->name()];
25 25
 				if (method_exists($this, $method)) {
26 26
 					$this->$method($event, $recipients);
27 27
 				}
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 							'conditions' => ['Entry.id' => $event->data['data']['Entry'][$idKey]]
44 44
 					]);
45 45
 
46
-			$lang = Configure::read( 'Config.language');
46
+			$lang = Configure::read('Config.language');
47 47
 			$config = [
48 48
 					'subject' => __('New reply to "%s"', $subject['Entry']['subject']),
49
-					'template' => $lang . DS . 'notification-model-entry-afterReply',
49
+					'template' => $lang.DS.'notification-model-entry-afterReply',
50 50
 					'viewVars' => [
51 51
 							'parentEntry' => $subject,
52 52
 							'newEntry' => $event->data['data'],
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 				'subject' => __('Successfull registration'),
77 77
 				'template' => Configure::read(
78 78
 					'Config.language'
79
-				) . DS . 'notification-admin-user_activated',
79
+				).DS.'notification-admin-user_activated',
80 80
 				'viewVars' => array('user' => $newUser, 'ip' => env('REMOTE_ADDR')),
81 81
 
82 82
 			];
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 		protected function _shouldRecipientReceiveReplyMessage($recipient, $entry) {
90 90
 			if (Configure::read('debug') === 0 &&
91 91
 					// don't send answer if new entry belongs to the user itself
92
-					(int)$recipient['id'] === (int)$entry['user_id']
92
+					(int) $recipient['id'] === (int) $entry['user_id']
93 93
 			) {
94 94
 				return false;
95 95
 			} else {
Please login to merge, or discard this patch.
app/Controller/UploadsController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 					$a['Upload'] = $this->request->data['Upload'][0];
47 47
 					$a['Upload']['user_id'] = $this->Session->read('Auth.User.id');
48 48
 					$a['Upload']['file']['name'] = Inflector::slug(
49
-								$a['Upload']['user_id'] . '_' .
49
+								$a['Upload']['user_id'].'_'.
50 50
 								pathinfo($a['Upload']['file']['name'], PATHINFO_FILENAME)
51
-							) .
52
-							'.' . pathinfo(
51
+							).
52
+							'.'.pathinfo(
53 53
 								$a['Upload']['file']['name'],
54 54
 								PATHINFO_EXTENSION
55 55
 							);
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 					$this->Upload->Behaviors->FileUpload->setUp(
61 61
 						$this->Upload,
62 62
 						array(
63
-							'maxFileSize' => (int)Configure::read(
63
+							'maxFileSize' => (int) Configure::read(
64 64
 								'Saito.Settings.upload_max_img_size'
65 65
 							) * 1024
66 66
 						)
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
 			}
118 118
 			$this->autoRender = false;
119 119
 
120
-			$this->Upload->id = (int)$id;
120
+			$this->Upload->id = (int) $id;
121 121
 			$file = $this->Upload->read();
122 122
 			if ($file &&
123
-					(int)$file['Upload']['user_id'] === $this->CurrentUser->getId()
123
+					(int) $file['Upload']['user_id'] === $this->CurrentUser->getId()
124 124
 			) {
125 125
 				if (!$this->Upload->delete(null, false)) {
126 126
 					$this->JsData->addAppJsMessage(
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 		}
150 150
 
151 151
 		protected function _init() {
152
-			$this->maxUploadsPerUser = (int)Configure::read(
152
+			$this->maxUploadsPerUser = (int) Configure::read(
153 153
 				'Saito.Settings.upload_max_number_of_uploads'
154 154
 			);
155 155
 			$countCurrent = $this->Upload->countUser($this->CurrentUser->getId());
Please login to merge, or discard this patch.
app/Plugin/SimpleCaptcha/View/Helper/SimpleCaptchaHelper.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 
18 18
 	private $captcha_text	 	= null;
19 19
 	private $captcha_result = null;
20
-	private $captcha_hash		= null;
20
+	private $captcha_hash = null;
21 21
 	private $captcha_generated = false;
22 22
 
23 23
 	function __construct(View $View, $settings = array()) {
24 24
 		$this->options = SimpleCaptcha::$defaults;
25 25
 
26 26
 		# Set up an array with the operators that we want to use. With difficulty=1 it is only subtraction and addition.
27
-		$this->captcha_operator_convert = array( '-' );
27
+		$this->captcha_operator_convert = array('-');
28 28
 
29
-		$configs = (array)Configure::read('Captcha');
29
+		$configs = (array) Configure::read('Captcha');
30 30
 		if (!empty($configs)) {
31 31
 			$this->options = array_merge($this->options, $configs);
32 32
 		}
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
   	$captchaOperator = $this->captcha_operator_convert[mt_rand(0, count($this->captcha_operator_convert) - 1)];
51 51
 
52 52
   	# Get the equation in textual form to show to the user.
53
-  	$this->captcha_text =  $numberOne . ' ' . $captchaOperator . ' ' . $numberTwo;
53
+  	$this->captcha_text = $numberOne.' '.$captchaOperator.' '.$numberTwo;
54 54
 
55 55
   	# Evaluate the equation and get the result.
56 56
 		$this->captcha_result = $numberOne - $numberTwo;
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 * @return string
79 79
 	 */
80 80
 	public function input($model = null, $options = array()) {
81
-		return $this->active($model, $options) . $this->passive($model, $options);
81
+		return $this->active($model, $options).$this->passive($model, $options);
82 82
 		return $out;
83 83
 	}
84 84
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		$out = '<div style="display:none">'.
96 96
             $this->Form->input($field.'_hash', array('value'=>$this->captcha_hash)).
97 97
             $this->Form->input($field.'_time', array('value'=>time())).
98
-            $this->Form->input((!empty($model)?$model.'.':'').$this->options['dummyField'], array('value'=>'')).
98
+            $this->Form->input((!empty($model) ? $model.'.' : '').$this->options['dummyField'], array('value'=>'')).
99 99
         '</div>';
100 100
 
101 101
 		return $out;
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 				'class'=>'captcha',
118 118
 				'value'=>'',
119 119
 				'maxlength'=>3,
120
-				'label'=>__('Captcha',true),
120
+				'label'=>__('Captcha', true),
121 121
 				'combined'=>true, 'autocomplete'=>'off'
122 122
 			);
123 123
 		$options = array_merge($defaultOptions, $options);
Please login to merge, or discard this patch.
app/Plugin/SimpleCaptcha/Model/Behavior/SimpleCaptchaBehavior.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		$dummyField = $this->settings[$this->Model->alias]['dummyField'];
92 92
 		if (!empty($data[$dummyField])) {
93 93
 			# dummy field not empty - SPAM!
94
-			return $this->error('Illegal content', 'DummyField = \'' . $data[$dummyField] . '\'');
94
+			return $this->error('Illegal content', 'DummyField = \''.$data[$dummyField].'\'');
95 95
 		}
96 96
 		return true;
97 97
 	}
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 		}
109 109
 
110 110
 		if (isSet($data['captcha_hash']) && isSet($data['captcha_time'])
111
-				&& ( $data['captcha_time'] < time() - $this->settings[$this->Model->alias]['minTime'] )
111
+				&& ($data['captcha_time'] < time() - $this->settings[$this->Model->alias]['minTime'])
112 112
 		) {
113 113
 			return true;
114 114
 		}
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 			return true;
128 128
 		}
129 129
 		if (isSet($data['captcha_hash']) && isSet($data['captcha_time'])
130
-				&& ( $data['captcha_time'] + $this->settings[$this->Model->alias]['maxTime'] > time() )
130
+				&& ($data['captcha_time'] + $this->settings[$this->Model->alias]['maxTime'] > time())
131 131
 		) {
132 132
 			return true;
133 133
 		}
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 			return true;
162 162
 		}
163 163
 		# wrong captcha content or session expired
164
-		return $this->error('Captcha incorrect', 'SubmittedResult = \'' . $data['captcha'] . '\'');
164
+		return $this->error('Captcha incorrect', 'SubmittedResult = \''.$data['captcha'].'\'');
165 165
 	}
166 166
 
167 167
 	/**
@@ -210,12 +210,12 @@  discard block
 block discarded – undo
210 210
 		}
211 211
 
212 212
 		App::import('Component', 'RequestHandler');
213
-		$msg = 'Ip \'' . RequestHandlerComponent::getClientIP() . '\', Agent \'' . env('HTTP_USER_AGENT') . '\', Referer \'' . env('HTTP_REFERER') . '\', Host-Referer \'' . RequestHandlerComponent::getReferer() . '\'';
213
+		$msg = 'Ip \''.RequestHandlerComponent::getClientIP().'\', Agent \''.env('HTTP_USER_AGENT').'\', Referer \''.env('HTTP_REFERER').'\', Host-Referer \''.RequestHandlerComponent::getReferer().'\'';
214 214
 		if (!empty($this->error)) {
215
-			$msg .= ', ' . $this->error;
215
+			$msg .= ', '.$this->error;
216 216
 		}
217 217
 		if (!empty($this->internalError)) {
218
-			$msg .= ' (' . $this->internalError . ')';
218
+			$msg .= ' ('.$this->internalError.')';
219 219
 		}
220 220
 		$this->log($msg, 'captcha');
221 221
 		return true;
Please login to merge, or discard this patch.