Completed
Push — master ( 0b068d...d5ee29 )
by Angus
03:03
created
application/controllers/ReportIssue.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 		$this->header_data['page']  = "report-issue";
13 13
 
14 14
 		$this->form_validation->set_rules('issue_description', 'Description', 'required|max_length[255]');
15
-		$this->form_validation->set_rules('issue_url',         'URL',         'valid_url');
15
+		$this->form_validation->set_rules('issue_url', 'URL', 'valid_url');
16 16
 
17 17
 
18 18
 		$this->body_data['issue_submitted'] = FALSE;
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 
22 22
 			if(!empty($this->input->post('website'))) {
23 23
 				$this->body_data['issue_submitted'] = FALSE;
24
-				log_message('error',"Bot attempting to spam report issue form: \"".$this->input->post('issue_description')."\"");
24
+				log_message('error', "Bot attempting to spam report issue form: \"".$this->input->post('issue_description')."\"");
25 25
 			} else {
26
-				$this->body_data['issue_submitted'] = $this->Tracker->issue->report("USERID:" . $this->User->id . " ||| " . $this->input->post('issue_description'), NULL, $this->input->post('issue_url'));
26
+				$this->body_data['issue_submitted'] = $this->Tracker->issue->report("USERID:".$this->User->id." ||| ".$this->input->post('issue_description'), NULL, $this->input->post('issue_url'));
27 27
 			}
28 28
 		}
29 29
 
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Sites_Model.php 1 patch
Braces   +33 added lines, -11 removed lines patch added patch discarded remove patch
@@ -125,7 +125,9 @@  discard block
 block discarded – undo
125 125
 	 */
126 126
 	final public function isValidTitleURL(string $title_url) : bool {
127 127
 		$success = (bool) preg_match($this->titleFormat, $title_url);
128
-		if(!$success) log_message('error', "Invalid Title URL ({$this->site}): {$title_url}");
128
+		if(!$success) {
129
+			log_message('error', "Invalid Title URL ({$this->site}): {$title_url}");
130
+		}
129 131
 		return $success;
130 132
 	}
131 133
 
@@ -139,7 +141,9 @@  discard block
 block discarded – undo
139 141
 	 */
140 142
 	final public function isValidChapter(string $chapter) : bool {
141 143
 		$success = (bool) preg_match($this->chapterFormat, $chapter);
142
-		if(!$success) log_message('error', "Invalid Chapter ({$this->site}): {$chapter}");
144
+		if(!$success) {
145
+			log_message('error', "Invalid Chapter ({$this->site}): {$chapter}");
146
+		}
143 147
 		return $success;
144 148
 	}
145 149
 
@@ -168,14 +172,20 @@  discard block
 block discarded – undo
168 172
 			//curl_setopt($ch, CURLOPT_VERBOSE, 1);
169 173
 			curl_setopt($ch, CURLOPT_HEADER, 1);
170 174
 
171
-			if($follow_redirect)        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
175
+			if($follow_redirect) {
176
+				curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
177
+			}
172 178
 
173 179
 			if($cookies = $this->cache->get("cloudflare_{$this->site}")) {
174 180
 				$cookie_string .= "; {$cookies}";
175 181
 			}
176 182
 
177
-			if(!empty($cookie_string))  curl_setopt($ch, CURLOPT_COOKIE, $cookie_string);
178
-			if(!empty($cookiejar_path)) curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar_path);
183
+			if(!empty($cookie_string)) {
184
+				curl_setopt($ch, CURLOPT_COOKIE, $cookie_string);
185
+			}
186
+			if(!empty($cookiejar_path)) {
187
+				curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar_path);
188
+			}
179 189
 
180 190
 			//Some sites check the useragent for stuff, use a pre-defined user-agent to avoid stuff.
181 191
 			curl_setopt($ch, CURLOPT_USERAGENT, $this->userAgent);
@@ -206,7 +216,9 @@  discard block
 block discarded – undo
206 216
 			$body        = substr($response, $header_size);
207 217
 			curl_close($ch);
208 218
 
209
-			if($status_code === 503) $refresh = $this->handleCloudFlare($url, $body);
219
+			if($status_code === 503) {
220
+				$refresh = $this->handleCloudFlare($url, $body);
221
+			}
210 222
 		}
211 223
 
212 224
 		return [
@@ -312,7 +324,9 @@  discard block
 block discarded – undo
312 324
 								'nodes_chapter' => $nodes_chapter->item(0)
313 325
 							];
314 326
 
315
-							if(is_callable($extraCall)) $extraCall($xpath, $returnData);
327
+							if(is_callable($extraCall)) {
328
+								$extraCall($xpath, $returnData);
329
+							}
316 330
 
317 331
 							return $returnData;
318 332
 						} else {
@@ -451,8 +465,12 @@  discard block
 block discarded – undo
451 465
 		$status = FALSE;
452 466
 
453 467
 		//Make sure we have a volume element
454
-		if(count($oldChapterSegments) === 1) array_unshift($oldChapterSegments, 'v0');
455
-		if(count($newChapterSegments) === 1) array_unshift($newChapterSegments, 'v0');
468
+		if(count($oldChapterSegments) === 1) {
469
+			array_unshift($oldChapterSegments, 'v0');
470
+		}
471
+		if(count($newChapterSegments) === 1) {
472
+			array_unshift($newChapterSegments, 'v0');
473
+		}
456 474
 
457 475
 		$oldCount = count($oldChapterSegments);
458 476
 		$newCount = count($newChapterSegments);
@@ -465,8 +483,12 @@  discard block
 block discarded – undo
465 483
 				$newVolume = substr(array_shift($newChapterSegments), 1);
466 484
 
467 485
 				//Forcing volume to 0 as TBD might not be the latest (although it can be, but that is covered by other checks)
468
-				if(in_array($oldVolume, ['TBD', 'TBA', 'NA', 'LMT'])) $oldVolume = 0;
469
-				if(in_array($newVolume, ['TBD', 'TBA', 'NA', 'LMT'])) $newVolume = 0;
486
+				if(in_array($oldVolume, ['TBD', 'TBA', 'NA', 'LMT'])) {
487
+					$oldVolume = 0;
488
+				}
489
+				if(in_array($newVolume, ['TBD', 'TBA', 'NA', 'LMT'])) {
490
+					$newVolume = 0;
491
+				}
470 492
 
471 493
 				$oldVolume = floatval($oldVolume);
472 494
 				$newVolume = floatval($newVolume);
Please login to merge, or discard this patch.