Completed
Push — master ( 027077...76536b )
by mains
02:56
created
php/Requests/libary/Requests/Cookie.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		$this->flags = array_merge($default_flags, $flags);
78 78
 
79 79
 		$this->reference_time = time();
80
-		if ($reference_time !== null) {
80
+		if($reference_time !== null) {
81 81
 			$this->reference_time = $reference_time;
82 82
 		}
83 83
 
@@ -97,12 +97,12 @@  discard block
 block discarded – undo
97 97
 		// If a cookie has both the Max-Age and the Expires attribute, the Max-
98 98
 		// Age attribute has precedence and controls the expiration date of the
99 99
 		// cookie.
100
-		if (isset($this->attributes['max-age'])) {
100
+		if(isset($this->attributes['max-age'])) {
101 101
 			$max_age = $this->attributes['max-age'];
102 102
 			return $max_age < $this->reference_time;
103 103
 		}
104 104
 
105
-		if (isset($this->attributes['expires'])) {
105
+		if(isset($this->attributes['expires'])) {
106 106
 			$expires = $this->attributes['expires'];
107 107
 			return $expires < $this->reference_time;
108 108
 		}
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
 	 * @return boolean Whether the cookie is valid for the given URI
118 118
 	 */
119 119
 	public function uri_matches(Requests_IRI $uri) {
120
-		if (!$this->domain_matches($uri->host)) {
120
+		if(!$this->domain_matches($uri->host)) {
121 121
 			return false;
122 122
 		}
123 123
 
124
-		if (!$this->path_matches($uri->path)) {
124
+		if(!$this->path_matches($uri->path)) {
125 125
 			return false;
126 126
 		}
127 127
 
@@ -135,37 +135,37 @@  discard block
 block discarded – undo
135 135
 	 * @return boolean Whether the cookie is valid for the given domain
136 136
 	 */
137 137
 	public function domain_matches($string) {
138
-		if (!isset($this->attributes['domain'])) {
138
+		if(!isset($this->attributes['domain'])) {
139 139
 			// Cookies created manually; cookies created by Requests will set
140 140
 			// the domain to the requested domain
141 141
 			return true;
142 142
 		}
143 143
 
144 144
 		$domain_string = $this->attributes['domain'];
145
-		if ($domain_string === $string) {
145
+		if($domain_string === $string) {
146 146
 			// The domain string and the string are identical.
147 147
 			return true;
148 148
 		}
149 149
 
150 150
 		// If the cookie is marked as host-only and we don't have an exact
151 151
 		// match, reject the cookie
152
-		if ($this->flags['host-only'] === true) {
152
+		if($this->flags['host-only'] === true) {
153 153
 			return false;
154 154
 		}
155 155
 
156
-		if (strlen($string) <= strlen($domain_string)) {
156
+		if(strlen($string) <= strlen($domain_string)) {
157 157
 			// For obvious reasons, the string cannot be a suffix if the domain
158 158
 			// is shorter than the domain string
159 159
 			return false;
160 160
 		}
161 161
 
162
-		if (substr($string, -1 * strlen($domain_string)) !== $domain_string) {
162
+		if(substr($string, -1 * strlen($domain_string)) !== $domain_string) {
163 163
 			// The domain string should be a suffix of the string.
164 164
 			return false;
165 165
 		}
166 166
 
167 167
 		$prefix = substr($string, 0, strlen($string) - strlen($domain_string));
168
-		if (substr($prefix, -1) !== '.') {
168
+		if(substr($prefix, -1) !== '.') {
169 169
 			// The last character of the string that is not included in the
170 170
 			// domain string should be a %x2E (".") character.
171 171
 			return false;
@@ -184,12 +184,12 @@  discard block
 block discarded – undo
184 184
 	 * @return boolean Whether the cookie is valid for the given path
185 185
 	 */
186 186
 	public function path_matches($request_path) {
187
-		if (empty($request_path)) {
187
+		if(empty($request_path)) {
188 188
 			// Normalize empty path to root
189 189
 			$request_path = '/';
190 190
 		}
191 191
 
192
-		if (!isset($this->attributes['path'])) {
192
+		if(!isset($this->attributes['path'])) {
193 193
 			// Cookies created manually; cookies created by Requests will set
194 194
 			// the path to the requested path
195 195
 			return true;
@@ -197,19 +197,19 @@  discard block
 block discarded – undo
197 197
 
198 198
 		$cookie_path = $this->attributes['path'];
199 199
 
200
-		if ($cookie_path === $request_path) {
200
+		if($cookie_path === $request_path) {
201 201
 			// The cookie-path and the request-path are identical.
202 202
 			return true;
203 203
 		}
204 204
 
205
-		if (strlen($request_path) > strlen($cookie_path) && substr($request_path, 0, strlen($cookie_path)) === $cookie_path) {
206
-			if (substr($cookie_path, -1) === '/') {
205
+		if(strlen($request_path) > strlen($cookie_path) && substr($request_path, 0, strlen($cookie_path)) === $cookie_path) {
206
+			if(substr($cookie_path, -1) === '/') {
207 207
 				// The cookie-path is a prefix of the request-path, and the last
208 208
 				// character of the cookie-path is %x2F ("/").
209 209
 				return true;
210 210
 			}
211 211
 
212
-			if (substr($request_path, strlen($cookie_path), 1) === '/') {
212
+			if(substr($request_path, strlen($cookie_path), 1) === '/') {
213 213
 				// The cookie-path is a prefix of the request-path, and the
214 214
 				// first character of the request-path that is not included in
215 215
 				// the cookie-path is a %x2F ("/") character.
@@ -226,15 +226,15 @@  discard block
 block discarded – undo
226 226
 	 * @return boolean Whether the cookie was successfully normalized
227 227
 	 */
228 228
 	public function normalize() {
229
-		foreach ($this->attributes as $key => $value) {
229
+		foreach($this->attributes as $key => $value) {
230 230
 			$orig_value = $value;
231 231
 			$value = $this->normalize_attribute($key, $value);
232
-			if ($value === null) {
232
+			if($value === null) {
233 233
 				unset($this->attributes[$key]);
234 234
 				continue;
235 235
 			}
236 236
 
237
-			if ($value !== $orig_value) {
237
+			if($value !== $orig_value) {
238 238
 				$this->attributes[$key] = $value;
239 239
 			}
240 240
 		}
@@ -252,15 +252,15 @@  discard block
 block discarded – undo
252 252
 	 * @return mixed Value if available, or null if the attribute value is invalid (and should be skipped)
253 253
 	 */
254 254
 	protected function normalize_attribute($name, $value) {
255
-		switch (strtolower($name)) {
255
+		switch(strtolower($name)) {
256 256
 			case 'expires':
257 257
 				// Expiration parsing, as per RFC 6265 section 5.2.1
258
-				if (is_int($value)) {
258
+				if(is_int($value)) {
259 259
 					return $value;
260 260
 				}
261 261
 
262 262
 				$expiry_time = strtotime($value);
263
-				if ($expiry_time === false) {
263
+				if($expiry_time === false) {
264 264
 					return null;
265 265
 				}
266 266
 
@@ -268,17 +268,17 @@  discard block
 block discarded – undo
268 268
 
269 269
 			case 'max-age':
270 270
 				// Expiration parsing, as per RFC 6265 section 5.2.2
271
-				if (is_int($value)) {
271
+				if(is_int($value)) {
272 272
 					return $value;
273 273
 				}
274 274
 
275 275
 				// Check that we have a valid age
276
-				if (!preg_match('/^-?\d+$/', $value)) {
276
+				if(!preg_match('/^-?\d+$/', $value)) {
277 277
 					return null;
278 278
 				}
279 279
 
280
-				$delta_seconds = (int) $value;
281
-				if ($delta_seconds <= 0) {
280
+				$delta_seconds = (int)$value;
281
+				if($delta_seconds <= 0) {
282 282
 					$expiry_time = 0;
283 283
 				}
284 284
 				else {
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 
290 290
 			case 'domain':
291 291
 				// Domain normalization, as per RFC 6265 section 5.2.3
292
-				if ($value[0] === '.') {
292
+				if($value[0] === '.') {
293 293
 					$value = substr($value, 1);
294 294
 				}
295 295
 
@@ -332,11 +332,11 @@  discard block
 block discarded – undo
332 332
 	 */
333 333
 	public function format_for_set_cookie() {
334 334
 		$header_value = $this->format_for_header();
335
-		if (!empty($this->attributes)) {
335
+		if(!empty($this->attributes)) {
336 336
 			$parts = array();
337
-			foreach ($this->attributes as $key => $value) {
337
+			foreach($this->attributes as $key => $value) {
338 338
 				// Ignore non-associative attributes
339
-				if (is_numeric($key)) {
339
+				if(is_numeric($key)) {
340 340
 					$parts[] = $value;
341 341
 				}
342 342
 				else {
@@ -383,10 +383,10 @@  discard block
 block discarded – undo
383 383
 		$parts = explode(';', $string);
384 384
 		$kvparts = array_shift($parts);
385 385
 
386
-		if (!empty($name)) {
386
+		if(!empty($name)) {
387 387
 			$value = $string;
388 388
 		}
389
-		elseif (strpos($kvparts, '=') === false) {
389
+		elseif(strpos($kvparts, '=') === false) {
390 390
 			// Some sites might only have a value without the equals separator.
391 391
 			// Deviate from RFC 6265 and pretend it was actually a blank name
392 392
 			// (`=foo`)
@@ -404,9 +404,9 @@  discard block
 block discarded – undo
404 404
 		// Attribute key are handled case-insensitively
405 405
 		$attributes = new Requests_Utility_CaseInsensitiveDictionary();
406 406
 
407
-		if (!empty($parts)) {
408
-			foreach ($parts as $part) {
409
-				if (strpos($part, '=') === false) {
407
+		if(!empty($parts)) {
408
+			foreach($parts as $part) {
409
+				if(strpos($part, '=') === false) {
410 410
 					$part_key = $part;
411 411
 					$part_value = true;
412 412
 				}
@@ -433,16 +433,16 @@  discard block
 block discarded – undo
433 433
 	 */
434 434
 	public static function parse_from_headers(Requests_Response_Headers $headers, Requests_IRI $origin = null, $time = null) {
435 435
 		$cookie_headers = $headers->getValues('Set-Cookie');
436
-		if (empty($cookie_headers)) {
436
+		if(empty($cookie_headers)) {
437 437
 			return array();
438 438
 		}
439 439
 
440 440
 		$cookies = array();
441
-		foreach ($cookie_headers as $header) {
441
+		foreach($cookie_headers as $header) {
442 442
 			$parsed = self::parse($header, '', $time);
443 443
 
444 444
 			// Default domain/path attributes
445
-			if (empty($parsed->attributes['domain']) && !empty($origin)) {
445
+			if(empty($parsed->attributes['domain']) && !empty($origin)) {
446 446
 				$parsed->attributes['domain'] = $origin->host;
447 447
 				$parsed->flags['host-only'] = true;
448 448
 			}
@@ -451,17 +451,17 @@  discard block
 block discarded – undo
451 451
 			}
452 452
 
453 453
 			$path_is_valid = (!empty($parsed->attributes['path']) && $parsed->attributes['path'][0] === '/');
454
-			if (!$path_is_valid && !empty($origin)) {
454
+			if(!$path_is_valid && !empty($origin)) {
455 455
 				$path = $origin->path;
456 456
 
457 457
 				// Default path normalization as per RFC 6265 section 5.1.4
458
-				if (substr($path, 0, 1) !== '/') {
458
+				if(substr($path, 0, 1) !== '/') {
459 459
 					// If the uri-path is empty or if the first character of
460 460
 					// the uri-path is not a %x2F ("/") character, output
461 461
 					// %x2F ("/") and skip the remaining steps.
462 462
 					$path = '/';
463 463
 				}
464
-				elseif (substr_count($path, '/') === 1) {
464
+				elseif(substr_count($path, '/') === 1) {
465 465
 					// If the uri-path contains no more than one %x2F ("/")
466 466
 					// character, output %x2F ("/") and skip the remaining
467 467
 					// step.
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 			}
478 478
 
479 479
 			// Reject invalid cookie domains
480
-			if (!empty($origin) && !$parsed->domain_matches($origin->host)) {
480
+			if(!empty($origin) && !$parsed->domain_matches($origin->host)) {
481 481
 				continue;
482 482
 			}
483 483
 
Please login to merge, or discard this patch.
php/Requests/libary/Requests.php 1 patch
Spacing   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -137,12 +137,12 @@  discard block
 block discarded – undo
137 137
 	 */
138 138
 	public static function autoloader($class) {
139 139
 		// Check that the class starts with "Requests"
140
-		if (strpos($class, 'Requests') !== 0) {
140
+		if(strpos($class, 'Requests') !== 0) {
141 141
 			return;
142 142
 		}
143 143
 
144 144
 		$file = str_replace('_', '/', $class);
145
-		if (file_exists(dirname(__FILE__) . '/' . $file . '.php')) {
145
+		if(file_exists(dirname(__FILE__) . '/' . $file . '.php')) {
146 146
 			require_once(dirname(__FILE__) . '/' . $file . '.php');
147 147
 		}
148 148
 	}
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	 * @param string $transport Transport class to add, must support the Requests_Transport interface
163 163
 	 */
164 164
 	public static function add_transport($transport) {
165
-		if (empty(self::$transports)) {
165
+		if(empty(self::$transports)) {
166 166
 			self::$transports = array(
167 167
 				'Requests_Transport_cURL',
168 168
 				'Requests_Transport_fsockopen',
@@ -186,12 +186,12 @@  discard block
 block discarded – undo
186 186
 		$cap_string = serialize($capabilities);
187 187
 
188 188
 		// Don't search for a transport if it's already been done for these $capabilities
189
-		if (isset(self::$transport[$cap_string]) && self::$transport[$cap_string] !== null) {
189
+		if(isset(self::$transport[$cap_string]) && self::$transport[$cap_string] !== null) {
190 190
 			return new self::$transport[$cap_string]();
191 191
 		}
192 192
 		// @codeCoverageIgnoreEnd
193 193
 
194
-		if (empty(self::$transports)) {
194
+		if(empty(self::$transports)) {
195 195
 			self::$transports = array(
196 196
 				'Requests_Transport_cURL',
197 197
 				'Requests_Transport_fsockopen',
@@ -199,18 +199,18 @@  discard block
 block discarded – undo
199 199
 		}
200 200
 
201 201
 		// Find us a working transport
202
-		foreach (self::$transports as $class) {
203
-			if (!class_exists($class)) {
202
+		foreach(self::$transports as $class) {
203
+			if(!class_exists($class)) {
204 204
 				continue;
205 205
 			}
206 206
 
207 207
 			$result = call_user_func(array($class, 'test'), $capabilities);
208
-			if ($result) {
208
+			if($result) {
209 209
 				self::$transport[$cap_string] = $class;
210 210
 				break;
211 211
 			}
212 212
 		}
213
-		if (self::$transport[$cap_string] === null) {
213
+		if(self::$transport[$cap_string] === null) {
214 214
 			throw new Requests_Exception('No working transports found', 'notransport', self::$transports);
215 215
 		}
216 216
 
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 	 * @return Requests_Response
356 356
 	 */
357 357
 	public static function request($url, $headers = array(), $data = array(), $type = self::GET, $options = array()) {
358
-		if (empty($options['type'])) {
358
+		if(empty($options['type'])) {
359 359
 			$options['type'] = $type;
360 360
 		}
361 361
 		$options = array_merge(self::get_default_options(), $options);
@@ -364,10 +364,10 @@  discard block
 block discarded – undo
364 364
 
365 365
 		$options['hooks']->dispatch('requests.before_request', array(&$url, &$headers, &$data, &$type, &$options));
366 366
 
367
-		if (!empty($options['transport'])) {
367
+		if(!empty($options['transport'])) {
368 368
 			$transport = $options['transport'];
369 369
 
370
-			if (is_string($options['transport'])) {
370
+			if(is_string($options['transport'])) {
371 371
 				$transport = new $transport();
372 372
 			}
373 373
 		}
@@ -427,29 +427,29 @@  discard block
 block discarded – undo
427 427
 	public static function request_multiple($requests, $options = array()) {
428 428
 		$options = array_merge(self::get_default_options(true), $options);
429 429
 
430
-		if (!empty($options['hooks'])) {
430
+		if(!empty($options['hooks'])) {
431 431
 			$options['hooks']->register('transport.internal.parse_response', array('Requests', 'parse_multiple'));
432
-			if (!empty($options['complete'])) {
432
+			if(!empty($options['complete'])) {
433 433
 				$options['hooks']->register('multiple.request.complete', $options['complete']);
434 434
 			}
435 435
 		}
436 436
 
437
-		foreach ($requests as $id => &$request) {
438
-			if (!isset($request['headers'])) {
437
+		foreach($requests as $id => &$request) {
438
+			if(!isset($request['headers'])) {
439 439
 				$request['headers'] = array();
440 440
 			}
441
-			if (!isset($request['data'])) {
441
+			if(!isset($request['data'])) {
442 442
 				$request['data'] = array();
443 443
 			}
444
-			if (!isset($request['type'])) {
444
+			if(!isset($request['type'])) {
445 445
 				$request['type'] = self::GET;
446 446
 			}
447
-			if (!isset($request['options'])) {
447
+			if(!isset($request['options'])) {
448 448
 				$request['options'] = $options;
449 449
 				$request['options']['type'] = $request['type'];
450 450
 			}
451 451
 			else {
452
-				if (empty($request['options']['type'])) {
452
+				if(empty($request['options']['type'])) {
453 453
 					$request['options']['type'] = $request['type'];
454 454
 				}
455 455
 				$request['options'] = array_merge($options, $request['options']);
@@ -458,19 +458,19 @@  discard block
 block discarded – undo
458 458
 			self::set_defaults($request['url'], $request['headers'], $request['data'], $request['type'], $request['options']);
459 459
 
460 460
 			// Ensure we only hook in once
461
-			if ($request['options']['hooks'] !== $options['hooks']) {
461
+			if($request['options']['hooks'] !== $options['hooks']) {
462 462
 				$request['options']['hooks']->register('transport.internal.parse_response', array('Requests', 'parse_multiple'));
463
-				if (!empty($request['options']['complete'])) {
463
+				if(!empty($request['options']['complete'])) {
464 464
 					$request['options']['hooks']->register('multiple.request.complete', $request['options']['complete']);
465 465
 				}
466 466
 			}
467 467
 		}
468 468
 		unset($request);
469 469
 
470
-		if (!empty($options['transport'])) {
470
+		if(!empty($options['transport'])) {
471 471
 			$transport = $options['transport'];
472 472
 
473
-			if (is_string($options['transport'])) {
473
+			if(is_string($options['transport'])) {
474 474
 				$transport = new $transport();
475 475
 			}
476 476
 		}
@@ -479,10 +479,10 @@  discard block
 block discarded – undo
479 479
 		}
480 480
 		$responses = $transport->request_multiple($requests, $options);
481 481
 
482
-		foreach ($responses as $id => &$response) {
482
+		foreach($responses as $id => &$response) {
483 483
 			// If our hook got messed with somehow, ensure we end up with the
484 484
 			// correct response
485
-			if (is_string($response)) {
485
+			if(is_string($response)) {
486 486
 				$request = $requests[$id];
487 487
 				self::parse_multiple($response, $request);
488 488
 				$request['options']['hooks']->dispatch('multiple.request.complete', array(&$response, $id));
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
 			'verify' => Requests::get_certificate_path(),
522 522
 			'verifyname' => true,
523 523
 		);
524
-		if ($multirequest !== false) {
524
+		if($multirequest !== false) {
525 525
 			$defaults['complete'] = null;
526 526
 		}
527 527
 		return $defaults;
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 	 * @return string Default certificate path.
534 534
 	 */
535 535
 	public static function get_certificate_path() {
536
-		if ( ! empty( Requests::$certificate_path ) ) {
536
+		if(!empty(Requests::$certificate_path)) {
537 537
 			return Requests::$certificate_path;
538 538
 		}
539 539
 
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 	 *
546 546
 	 * @param string $path Certificate path, pointing to a PEM file.
547 547
 	 */
548
-	public static function set_certificate_path( $path ) {
548
+	public static function set_certificate_path($path) {
549 549
 		Requests::$certificate_path = $path;
550 550
 	}
551 551
 
@@ -560,39 +560,39 @@  discard block
 block discarded – undo
560 560
 	 * @return array $options
561 561
 	 */
562 562
 	protected static function set_defaults(&$url, &$headers, &$data, &$type, &$options) {
563
-		if (!preg_match('/^http(s)?:\/\//i', $url, $matches)) {
563
+		if(!preg_match('/^http(s)?:\/\//i', $url, $matches)) {
564 564
 			throw new Requests_Exception('Only HTTP(S) requests are handled.', 'nonhttp', $url);
565 565
 		}
566 566
 
567
-		if (empty($options['hooks'])) {
567
+		if(empty($options['hooks'])) {
568 568
 			$options['hooks'] = new Requests_Hooks();
569 569
 		}
570 570
 
571
-		if (is_array($options['auth'])) {
571
+		if(is_array($options['auth'])) {
572 572
 			$options['auth'] = new Requests_Auth_Basic($options['auth']);
573 573
 		}
574
-		if ($options['auth'] !== false) {
574
+		if($options['auth'] !== false) {
575 575
 			$options['auth']->register($options['hooks']);
576 576
 		}
577 577
 
578
-		if (is_string($options['proxy']) || is_array($options['proxy'])) {
578
+		if(is_string($options['proxy']) || is_array($options['proxy'])) {
579 579
 			$options['proxy'] = new Requests_Proxy_HTTP($options['proxy']);
580 580
 		}
581
-		if ($options['proxy'] !== false) {
581
+		if($options['proxy'] !== false) {
582 582
 			$options['proxy']->register($options['hooks']);
583 583
 		}
584 584
 
585
-		if (is_array($options['cookies'])) {
585
+		if(is_array($options['cookies'])) {
586 586
 			$options['cookies'] = new Requests_Cookie_Jar($options['cookies']);
587 587
 		}
588
-		elseif (empty($options['cookies'])) {
588
+		elseif(empty($options['cookies'])) {
589 589
 			$options['cookies'] = new Requests_Cookie_Jar();
590 590
 		}
591
-		if ($options['cookies'] !== false) {
591
+		if($options['cookies'] !== false) {
592 592
 			$options['cookies']->register($options['hooks']);
593 593
 		}
594 594
 
595
-		if ($options['idn'] !== false) {
595
+		if($options['idn'] !== false) {
596 596
 			$iri = new Requests_IRI($url);
597 597
 			$iri->host = Requests_IDNAEncoder::encode($iri->ihost);
598 598
 			$url = $iri->uri;
@@ -601,8 +601,8 @@  discard block
 block discarded – undo
601 601
 		// Massage the type to ensure we support it.
602 602
 		$type = strtoupper($type);
603 603
 
604
-		if (!isset($options['data_format'])) {
605
-			if (in_array($type, array(self::HEAD, self::GET, self::DELETE))) {
604
+		if(!isset($options['data_format'])) {
605
+			if(in_array($type, array(self::HEAD, self::GET, self::DELETE))) {
606 606
 				$options['data_format'] = 'query';
607 607
 			}
608 608
 			else {
@@ -627,15 +627,15 @@  discard block
 block discarded – undo
627 627
 	 */
628 628
 	protected static function parse_response($headers, $url, $req_headers, $req_data, $options) {
629 629
 		$return = new Requests_Response();
630
-		if (!$options['blocking']) {
630
+		if(!$options['blocking']) {
631 631
 			return $return;
632 632
 		}
633 633
 
634 634
 		$return->raw = $headers;
635 635
 		$return->url = $url;
636 636
 
637
-		if (!$options['filename']) {
638
-			if (($pos = strpos($headers, "\r\n\r\n")) === false) {
637
+		if(!$options['filename']) {
638
+			if(($pos = strpos($headers, "\r\n\r\n")) === false) {
639 639
 				// Crap!
640 640
 				throw new Requests_Exception('Missing header/body separator', 'requests.no_crlf_separator');
641 641
 			}
@@ -652,44 +652,44 @@  discard block
 block discarded – undo
652 652
 		$headers = preg_replace('/\n[ \t]/', ' ', $headers);
653 653
 		$headers = explode("\n", $headers);
654 654
 		preg_match('#^HTTP/(1\.\d)[ \t]+(\d+)#i', array_shift($headers), $matches);
655
-		if (empty($matches)) {
655
+		if(empty($matches)) {
656 656
 			throw new Requests_Exception('Response could not be parsed', 'noversion', $headers);
657 657
 		}
658
-		$return->protocol_version = (float) $matches[1];
659
-		$return->status_code = (int) $matches[2];
660
-		if ($return->status_code >= 200 && $return->status_code < 300) {
658
+		$return->protocol_version = (float)$matches[1];
659
+		$return->status_code = (int)$matches[2];
660
+		if($return->status_code >= 200 && $return->status_code < 300) {
661 661
 			$return->success = true;
662 662
 		}
663 663
 
664
-		foreach ($headers as $header) {
664
+		foreach($headers as $header) {
665 665
 			list($key, $value) = explode(':', $header, 2);
666 666
 			$value = trim($value);
667 667
 			preg_replace('#(\s+)#i', ' ', $value);
668 668
 			$return->headers[$key] = $value;
669 669
 		}
670
-		if (isset($return->headers['transfer-encoding'])) {
670
+		if(isset($return->headers['transfer-encoding'])) {
671 671
 			$return->body = self::decode_chunked($return->body);
672 672
 			unset($return->headers['transfer-encoding']);
673 673
 		}
674
-		if (isset($return->headers['content-encoding'])) {
674
+		if(isset($return->headers['content-encoding'])) {
675 675
 			$return->body = self::decompress($return->body);
676 676
 		}
677 677
 
678 678
 		//fsockopen and cURL compatibility
679
-		if (isset($return->headers['connection'])) {
679
+		if(isset($return->headers['connection'])) {
680 680
 			unset($return->headers['connection']);
681 681
 		}
682 682
 
683 683
 		$options['hooks']->dispatch('requests.before_redirect_check', array(&$return, $req_headers, $req_data, $options));
684 684
 
685
-		if ($return->is_redirect() && $options['follow_redirects'] === true) {
686
-			if (isset($return->headers['location']) && $options['redirected'] < $options['redirects']) {
687
-				if ($return->status_code === 303) {
685
+		if($return->is_redirect() && $options['follow_redirects'] === true) {
686
+			if(isset($return->headers['location']) && $options['redirected'] < $options['redirects']) {
687
+				if($return->status_code === 303) {
688 688
 					$options['type'] = self::GET;
689 689
 				}
690 690
 				$options['redirected']++;
691 691
 				$location = $return->headers['location'];
692
-				if (strpos($location, 'http://') !== 0 && strpos($location, 'https://') !== 0) {
692
+				if(strpos($location, 'http://') !== 0 && strpos($location, 'https://') !== 0) {
693 693
 					// relative redirect, for compatibility make it absolute
694 694
 					$location = Requests_IRI::absolutize($url, $location);
695 695
 					$location = $location->uri;
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
 				$redirected->history[] = $return;
708 708
 				return $redirected;
709 709
 			}
710
-			elseif ($options['redirected'] >= $options['redirects']) {
710
+			elseif($options['redirected'] >= $options['redirects']) {
711 711
 				throw new Requests_Exception('Too many redirects', 'toomanyredirects', $return);
712 712
 			}
713 713
 		}
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
 			$options = $request['options'];
737 737
 			$response = self::parse_response($response, $url, $headers, $data, $options);
738 738
 		}
739
-		catch (Requests_Exception $e) {
739
+		catch(Requests_Exception $e) {
740 740
 			$response = $e;
741 741
 		}
742 742
 	}
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
 	 * @return string Decoded body
750 750
 	 */
751 751
 	protected static function decode_chunked($data) {
752
-		if (!preg_match('/^([0-9a-f]+)(?:;(?:[\w-]*)(?:=(?:(?:[\w-]*)*|"(?:[^\r\n])*"))?)*\r\n/i', trim($data))) {
752
+		if(!preg_match('/^([0-9a-f]+)(?:;(?:[\w-]*)(?:=(?:(?:[\w-]*)*|"(?:[^\r\n])*"))?)*\r\n/i', trim($data))) {
753 753
 			return $data;
754 754
 		}
755 755
 
@@ -758,15 +758,15 @@  discard block
 block discarded – undo
758 758
 		$decoded = '';
759 759
 		$encoded = $data;
760 760
 
761
-		while (true) {
762
-			$is_chunked = (bool) preg_match('/^([0-9a-f]+)(?:;(?:[\w-]*)(?:=(?:(?:[\w-]*)*|"(?:[^\r\n])*"))?)*\r\n/i', $encoded, $matches);
763
-			if (!$is_chunked) {
761
+		while(true) {
762
+			$is_chunked = (bool)preg_match('/^([0-9a-f]+)(?:;(?:[\w-]*)(?:=(?:(?:[\w-]*)*|"(?:[^\r\n])*"))?)*\r\n/i', $encoded, $matches);
763
+			if(!$is_chunked) {
764 764
 				// Looks like it's not chunked after all
765 765
 				return $data;
766 766
 			}
767 767
 
768 768
 			$length = hexdec(trim($matches[1]));
769
-			if ($length === 0) {
769
+			if($length === 0) {
770 770
 				// Ignore trailer headers
771 771
 				return $decoded;
772 772
 			}
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
 			$decoded .= substr($encoded, $chunk_length, $length);
776 776
 			$encoded = substr($encoded, $chunk_length + $length + 2);
777 777
 
778
-			if (trim($encoded) === '0' || empty($encoded)) {
778
+			if(trim($encoded) === '0' || empty($encoded)) {
779 779
 				return $decoded;
780 780
 			}
781 781
 		}
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
 	 */
794 794
 	public static function flatten($array) {
795 795
 		$return = array();
796
-		foreach ($array as $key => $value) {
796
+		foreach($array as $key => $value) {
797 797
 			$return[] = sprintf('%s: %s', $key, $value);
798 798
 		}
799 799
 		return $return;
@@ -821,21 +821,21 @@  discard block
 block discarded – undo
821 821
 	 * @return string Decompressed string
822 822
 	 */
823 823
 	public static function decompress($data) {
824
-		if (substr($data, 0, 2) !== "\x1f\x8b" && substr($data, 0, 2) !== "\x78\x9c") {
824
+		if(substr($data, 0, 2) !== "\x1f\x8b" && substr($data, 0, 2) !== "\x78\x9c") {
825 825
 			// Not actually compressed. Probably cURL ruining this for us.
826 826
 			return $data;
827 827
 		}
828 828
 
829
-		if (function_exists('gzdecode') && ($decoded = @gzdecode($data)) !== false) {
829
+		if(function_exists('gzdecode') && ($decoded = @gzdecode($data)) !== false) {
830 830
 			return $decoded;
831 831
 		}
832
-		elseif (function_exists('gzinflate') && ($decoded = @gzinflate($data)) !== false) {
832
+		elseif(function_exists('gzinflate') && ($decoded = @gzinflate($data)) !== false) {
833 833
 			return $decoded;
834 834
 		}
835
-		elseif (($decoded = self::compatible_gzinflate($data)) !== false) {
835
+		elseif(($decoded = self::compatible_gzinflate($data)) !== false) {
836 836
 			return $decoded;
837 837
 		}
838
-		elseif (function_exists('gzuncompress') && ($decoded = @gzuncompress($data)) !== false) {
838
+		elseif(function_exists('gzuncompress') && ($decoded = @gzuncompress($data)) !== false) {
839 839
 			return $decoded;
840 840
 		}
841 841
 
@@ -865,26 +865,26 @@  discard block
 block discarded – undo
865 865
 	public static function compatible_gzinflate($gzData) {
866 866
 		// Compressed data might contain a full zlib header, if so strip it for
867 867
 		// gzinflate()
868
-		if (substr($gzData, 0, 3) == "\x1f\x8b\x08") {
868
+		if(substr($gzData, 0, 3) == "\x1f\x8b\x08") {
869 869
 			$i = 10;
870 870
 			$flg = ord(substr($gzData, 3, 1));
871
-			if ($flg > 0) {
872
-				if ($flg & 4) {
871
+			if($flg > 0) {
872
+				if($flg&4) {
873 873
 					list($xlen) = unpack('v', substr($gzData, $i, 2));
874 874
 					$i = $i + 2 + $xlen;
875 875
 				}
876
-				if ($flg & 8) {
876
+				if($flg&8) {
877 877
 					$i = strpos($gzData, "\0", $i) + 1;
878 878
 				}
879
-				if ($flg & 16) {
879
+				if($flg&16) {
880 880
 					$i = strpos($gzData, "\0", $i) + 1;
881 881
 				}
882
-				if ($flg & 2) {
882
+				if($flg&2) {
883 883
 					$i = $i + 2;
884 884
 				}
885 885
 			}
886 886
 			$decompressed = self::compatible_gzinflate(substr($gzData, $i));
887
-			if (false !== $decompressed) {
887
+			if(false !== $decompressed) {
888 888
 				return $decompressed;
889 889
 			}
890 890
 		}
@@ -905,17 +905,17 @@  discard block
 block discarded – undo
905 905
 		// First 2 bytes should be divisible by 0x1F
906 906
 		list(, $first_two_bytes) = unpack('n', $gzData);
907 907
 
908
-		if (0x08 == $first_nibble && 0 == ($first_two_bytes % 0x1F)) {
908
+		if(0x08 == $first_nibble && 0 == ($first_two_bytes % 0x1F)) {
909 909
 			$huffman_encoded = true;
910 910
 		}
911 911
 
912
-		if ($huffman_encoded) {
913
-			if (false !== ($decompressed = @gzinflate(substr($gzData, 2)))) {
912
+		if($huffman_encoded) {
913
+			if(false !== ($decompressed = @gzinflate(substr($gzData, 2)))) {
914 914
 				return $decompressed;
915 915
 			}
916 916
 		}
917 917
 
918
-		if ("\x50\x4b\x03\x04" == substr($gzData, 0, 4)) {
918
+		if("\x50\x4b\x03\x04" == substr($gzData, 0, 4)) {
919 919
 			// ZIP file format header
920 920
 			// Offset 6: 2 bytes, General-purpose field
921 921
 			// Offset 26: 2 bytes, filename length
@@ -927,9 +927,9 @@  discard block
 block discarded – undo
927 927
 			// If the file has been compressed on the fly, 0x08 bit is set of
928 928
 			// the general purpose field. We can use this to differentiate
929 929
 			// between a compressed document, and a ZIP file
930
-			$zip_compressed_on_the_fly = (0x08 == (0x08 & $general_purpose_flag));
930
+			$zip_compressed_on_the_fly = (0x08 == (0x08&$general_purpose_flag));
931 931
 
932
-			if (!$zip_compressed_on_the_fly) {
932
+			if(!$zip_compressed_on_the_fly) {
933 933
 				// Don't attempt to decode a compressed zip file
934 934
 				return $gzData;
935 935
 			}
@@ -937,20 +937,20 @@  discard block
 block discarded – undo
937 937
 			// Determine the first byte of data, based on the above ZIP header
938 938
 			// offsets:
939 939
 			$first_file_start = array_sum(unpack('v2', substr($gzData, 26, 4)));
940
-			if (false !== ($decompressed = @gzinflate(substr($gzData, 30 + $first_file_start)))) {
940
+			if(false !== ($decompressed = @gzinflate(substr($gzData, 30 + $first_file_start)))) {
941 941
 				return $decompressed;
942 942
 			}
943 943
 			return false;
944 944
 		}
945 945
 
946 946
 		// Finally fall back to straight gzinflate
947
-		if (false !== ($decompressed = @gzinflate($gzData))) {
947
+		if(false !== ($decompressed = @gzinflate($gzData))) {
948 948
 			return $decompressed;
949 949
 		}
950 950
 
951 951
 		// Fallback for all above failing, not expected, but included for
952 952
 		// debugging and preventing regressions and to track stats
953
-		if (false !== ($decompressed = @gzinflate(substr($gzData, 2)))) {
953
+		if(false !== ($decompressed = @gzinflate(substr($gzData, 2)))) {
954 954
 			return $decompressed;
955 955
 		}
956 956
 
@@ -959,7 +959,7 @@  discard block
 block discarded – undo
959 959
 
960 960
 	public static function match_domain($host, $reference) {
961 961
 		// Check for a direct match
962
-		if ($host === $reference) {
962
+		if($host === $reference) {
963 963
 			return true;
964 964
 		}
965 965
 
@@ -967,10 +967,10 @@  discard block
 block discarded – undo
967 967
 		// Also validates that the host has 3 parts or more, as per Firefox's
968 968
 		// ruleset.
969 969
 		$parts = explode('.', $host);
970
-		if (ip2long($host) === false && count($parts) >= 3) {
970
+		if(ip2long($host) === false && count($parts) >= 3) {
971 971
 			$parts[0] = '*';
972 972
 			$wildcard = implode('.', $parts);
973
-			if ($wildcard === $reference) {
973
+			if($wildcard === $reference) {
974 974
 				return true;
975 975
 			}
976 976
 		}
Please login to merge, or discard this patch.
php/Requests/libary/Requests/Proxy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,5 +29,5 @@
 block discarded – undo
29 29
 	 * @see Requests_Hooks::register
30 30
 	 * @param Requests_Hooks $hooks Hook system
31 31
 	 */
32
-	public function register(Requests_Hooks &$hooks);
32
+	public function register(Requests_Hooks&$hooks);
33 33
 }
34 34
\ No newline at end of file
Please login to merge, or discard this patch.
php/Requests/CreateUser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
     {
38 38
         $str = '';
39 39
         $max = mb_strlen($keyspace, '8bit') - 1;
40
-        for ($i = 0; $i < $length; ++$i) {
40
+        for($i = 0; $i < $length; ++$i) {
41 41
             $str .= $keyspace[rand(0, $max)];
42 42
         }
43 43
         return $str;
Please login to merge, or discard this patch.
php/Requests/GetPosts.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,22 +11,22 @@  discard block
 block discarded – undo
11 11
     public $url;
12 12
 
13 13
         
14
-    function setUrl ($url)
14
+    function setUrl($url)
15 15
     {
16 16
             $this->url = $url;
17 17
     }
18 18
     
19
-    function getUrl ()
19
+    function getUrl()
20 20
     {
21 21
         return $this->url;
22 22
     }
23 23
 		
24
-    function setLastPostId ($lastPostId)
24
+    function setLastPostId($lastPostId)
25 25
     {
26 26
 			$this->lastPostId = $lastPostId;
27 27
 	}
28 28
 	
29
-	function getlastPostId ()
29
+	function getlastPostId()
30 30
 	{
31 31
 		return $this->lastPostId;
32 32
 	}
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     {
36 36
         $apiEndPoint = $this->getUrl();
37 37
 
38
-        if ($this->getLastPostId() != "") {
38
+        if($this->getLastPostId() != "") {
39 39
 			$apiEndPoint = $this->getUrl() . '?after=' . $this->getLastPostId();
40 40
 		}
41 41
         return $apiEndPoint;
Please login to merge, or discard this patch.
php/Requests/AbstractRequest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $header = $this->getSignHeaders();
29 29
         $url = $this->getFullUrl();
30 30
 
31
-        if ($this->getAccessToken()) {
31
+        if($this->getAccessToken()) {
32 32
             $header['Authorization'] = "Bearer " . $this->getAccessToken();
33 33
         }
34 34
         //Comment out to debug the Request:
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             'proxy' => '186.103.169.165:8080',
51 51
         );*/
52 52
 
53
-        switch ($this->getMethod()) {
53
+        switch($this->getMethod()) {
54 54
             case 'POST':
55 55
                 $result = Requests::post($url, $header, $this->payLoad);
56 56
                 break;
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                 $result = Requests::put($url, $header, $this->payLoad);
69 69
                 break;
70 70
         }
71
-        switch ($result->status_code) {
71
+        switch($result->status_code) {
72 72
             case 200:
73 73
                 $result = json_decode($result->body, true);
74 74
                 break;
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                 exit("Error 403: Access denied");
97 97
                 break;
98 98
             default:
99
-                error_log('Error '.$result->status_code.' - Unauthorized'); // - JodelDeviceId:' . $deviceUid);
99
+                error_log('Error ' . $result->status_code . ' - Unauthorized'); // - JodelDeviceId:' . $deviceUid);
100 100
                 //throw  new \Exception('Unknown Error: '.$result->status_code);
101 101
         }
102 102
 
Please login to merge, or discard this patch.
vote-ajax.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 $config = parse_ini_file('config/config.ini.php');
4 4
 if(!isset($_GET['pw']) || $config['pw'] != $_GET['pw'])
5 5
 {
6
-	error_log($_SERVER['REMOTE_ADDR']  . ' used a wrong password on vote-ajax.php');
7
-	$respone = array("message" => $_SERVER['REMOTE_ADDR']  . ' used a wrong password on vote-ajax.php',"success" => false);
6
+	error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php');
7
+	$respone = array("message" => $_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php', "success" => false);
8 8
 	echo json_encode($response);
9 9
 	
10 10
 	die();
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 		}
56 56
 	}
57 57
 
58
-if (isset($captcha))
58
+if(isset($captcha))
59 59
 {
60 60
 	$response = array("success" => $success, "message" => $message, "captcha" => $captcha, "deviceUid" => $deviceUid);
61 61
 }
Please login to merge, or discard this patch.
php/JodelAccount.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         {
36 36
             $this->refreshToken();
37 37
         }
38
-        $this->accessToken  = $this->getAccessToken();
38
+        $this->accessToken = $this->getAccessToken();
39 39
     }
40 40
 
41 41
     function isAccountVerified()
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
         }
65 65
 
66 66
         $db = new DatabaseConnect();
67
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
67
+        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
68 68
         
69 69
         $location = new Location();
70 70
         
71
-        if ($result->num_rows > 0)
71
+        if($result->num_rows > 0)
72 72
         {
73 73
             // output data of each row
74 74
             while($row = $result->fetch_assoc())
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                     }
142 142
                     else
143 143
                     {
144
-                        error_log('User with JodelDeviceId:' . $this->deviceUid .  ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name);
144
+                        error_log('User with JodelDeviceId:' . $this->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name);
145 145
                     }
146 146
                 }
147 147
 
@@ -153,11 +153,11 @@  discard block
 block discarded – undo
153 153
     function getLocation()
154 154
     {
155 155
         $db = new DatabaseConnect();
156
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
156
+        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
157 157
         
158 158
         $location = new Location();
159 159
         
160
-        if ($result->num_rows > 0)
160
+        if($result->num_rows > 0)
161 161
         {
162 162
             // output data of each row
163 163
             while($row = $result->fetch_assoc())
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
         if(isset($_POST['color']))
263 263
         {
264 264
             $color = $_POST['color'];
265
-            switch ($color) {
265
+            switch($color) {
266 266
                 case '8ABDB0':
267 267
                     $color = '8ABDB0';
268 268
                     break;
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
         $db = new DatabaseConnect();  
317 317
         $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
318 318
 
319
-        if ($result->num_rows > 0)
319
+        if($result->num_rows > 0)
320 320
         {
321 321
             // output data of each row
322 322
             while($row = $result->fetch_assoc())
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
                                     expiration_date='" . $expiration_date . "'
356 356
                                 WHERE device_uid='" . $device_uid . "'");
357 357
 
358
-        if($result === false){
358
+        if($result === false) {
359 359
                 error_log("Adding account failed: (" . $db->errno . ") " . $db->error);
360 360
         }   
361 361
     }
@@ -365,11 +365,11 @@  discard block
 block discarded – undo
365 365
     function getAccessToken()
366 366
     {
367 367
         $db = new DatabaseConnect();
368
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
368
+        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
369 369
         
370 370
         $accessToken;
371 371
         
372
-        if ($result->num_rows > 0)
372
+        if($result->num_rows > 0)
373 373
         {
374 374
             // output data of each row
375 375
             while($row = $result->fetch_assoc())
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
         $result = $db->query("INSERT INTO votes (device_uid, postId, type)
436 436
                         VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')");
437 437
         
438
-        if($result === false){
438
+        if($result === false) {
439 439
                 $error = db_error();
440 440
                 echo $error;
441 441
                 echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
@@ -463,11 +463,11 @@  discard block
 block discarded – undo
463 463
         $result = $db->query("INSERT INTO accounts (access_token, refresh_token, token_type,
464 464
                         expires_in, expiration_date, distinct_id, device_uid, name, lat, lng)
465 465
                         VALUES ('" . $access_token . "','" . $refresh_token . "','" . $token_type .
466
-                        "','" .  $expires_in . "','" . $expiration_date . "','" . $distinct_id .
466
+                        "','" . $expires_in . "','" . $expiration_date . "','" . $distinct_id .
467 467
                         "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
468 468
 
469 469
         $success = TRUE;
470
-        if($result === false){
470
+        if($result === false) {
471 471
                 $error = db_error();
472 472
                 echo $error;
473 473
                 echo "Adding account failed: (" . $result->errno . ") " . $result->error;
Please login to merge, or discard this patch.
admin.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 
5 5
 if(!isset($_GET['pw']) || $config['pw'] != $_GET['pw'])
6 6
 {
7
-	error_log($_SERVER['REMOTE_ADDR']  . ' used a wrong password on admin.php');
7
+	error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong password on admin.php');
8 8
 	die();
9 9
 }
10 10
 
@@ -56,42 +56,42 @@  discard block
 block discarded – undo
56 56
 		<meta name="keywords" content="jodelblue, jodel, blue, webclient, web, client">
57 57
 		
58 58
 		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" integrity="sha384-AysaV+vQoT3kOAXZkl02PThvDr8HYKPZhNT5h/CXfBThSRXQ6jW5DO2ekP5ViFdi" crossorigin="anonymous">
59
-				<link rel="stylesheet" href="<?php echo $baseUrl;?>css/font-awesome.min.css">
60
-		<link rel="stylesheet" href="<?php echo $baseUrl;?>style.css" type="text/css">
59
+				<link rel="stylesheet" href="<?php echo $baseUrl; ?>css/font-awesome.min.css">
60
+		<link rel="stylesheet" href="<?php echo $baseUrl; ?>style.css" type="text/css">
61 61
 		
62
-		<link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico">
63
-		<link rel="icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico">
64
-		<link rel="icon" type="image/gif" href="<?php echo $baseUrl;?>img/favicon/favicon.gif">
65
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon.png">
66
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon.png">
67
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57">
68
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60">
69
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72">
70
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76">
71
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114">
72
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120">
73
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128">
74
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144">
75
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152">
76
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180">
77
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-precomposed.png">
78
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-16x16.png" sizes="16x16">
79
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-32x32.png" sizes="32x32">
80
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-96x96.png" sizes="96x96">
81
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-160x160.png" sizes="160x160">
82
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-192x192.png" sizes="192x192">
83
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-196x196.png" sizes="196x196">
84
-		<meta name="msapplication-TileImage" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> 
62
+		<link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico">
63
+		<link rel="icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico">
64
+		<link rel="icon" type="image/gif" href="<?php echo $baseUrl; ?>img/favicon/favicon.gif">
65
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon.png">
66
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon.png">
67
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57">
68
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60">
69
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72">
70
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76">
71
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114">
72
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120">
73
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128">
74
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144">
75
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152">
76
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180">
77
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-precomposed.png">
78
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-16x16.png" sizes="16x16">
79
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-32x32.png" sizes="32x32">
80
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-96x96.png" sizes="96x96">
81
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-160x160.png" sizes="160x160">
82
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-192x192.png" sizes="192x192">
83
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-196x196.png" sizes="196x196">
84
+		<meta name="msapplication-TileImage" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> 
85 85
 		<meta name="msapplication-TileColor" content="#5682a3"> 
86 86
 		<meta name="msapplication-navbutton-color" content="#5682a3"> 
87 87
 		<meta name="application-name" content="JodelBlue"/> 
88 88
 		<meta name="msapplication-tooltip" content="JodelBlue"/> 
89 89
 		<meta name="apple-mobile-web-app-title" content="JodelBlue"/> 
90
-		<meta name="msapplication-square70x70logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-70x70.png"> 
91
-		<meta name="msapplication-square144x144logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> 
92
-		<meta name="msapplication-square150x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-150x150.png"> 
93
-		<meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x150.png"> 
94
-		<meta name="msapplication-square310x310logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x310.png"> 
90
+		<meta name="msapplication-square70x70logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-70x70.png"> 
91
+		<meta name="msapplication-square144x144logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> 
92
+		<meta name="msapplication-square150x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-150x150.png"> 
93
+		<meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x150.png"> 
94
+		<meta name="msapplication-square310x310logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x310.png"> 
95 95
 	</head>
96 96
 	
97 97
 	<body>
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 			{
180 180
 				$.ajax({
181 181
 				  type: "POST",
182
-				  url: "<?php echo $baseUrl;?>vote-ajax.php?pw=<?php echo $_GET["pw"]?>",
182
+				  url: "<?php echo $baseUrl; ?>vote-ajax.php?pw=<?php echo $_GET["pw"]?>",
183 183
 				  data: {"vote" : data["vote"],
184 184
 						 "postId" : data["id"]},
185 185
 				  success: function(result){
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 				console.log(solution);
227 227
 				$.ajax({
228 228
 				  type: "POST",
229
-				  url: "<?php echo $baseUrl;?>vote-ajax.php?pw=<?php echo $_GET["pw"]?>&solution=" + solution + "&key="+key,
229
+				  url: "<?php echo $baseUrl; ?>vote-ajax.php?pw=<?php echo $_GET["pw"]?>&solution=" + solution + "&key="+key,
230 230
 				  data: {"deviceUid" : deviceUid},
231 231
 				  success: function(result){
232 232
 					  var response = JSON.parse(result);
Please login to merge, or discard this patch.