Completed
Pull Request — release-2.1 (#3785)
by Fran
08:32
created
Sources/ReCaptcha/ReCaptcha/RequestMethod/Socket.php 1 patch
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -32,74 +32,74 @@
 block discarded – undo
32 32
  */
33 33
 class Socket
34 34
 {
35
-    private $handle = null;
35
+	private $handle = null;
36 36
 
37
-    /**
38
-     * fsockopen
39
-     * 
40
-     * @see http://php.net/fsockopen
41
-     * @param string $hostname
42
-     * @param int $port
43
-     * @param int $errno
44
-     * @param string $errstr
45
-     * @param float $timeout
46
-     * @return resource
47
-     */
48
-    public function fsockopen($hostname, $port = -1, &$errno = 0, &$errstr = '', $timeout = null)
49
-    {
50
-        $this->handle = fsockopen($hostname, $port, $errno, $errstr, (is_null($timeout) ? ini_get("default_socket_timeout") : $timeout));
37
+	/**
38
+	 * fsockopen
39
+	 * 
40
+	 * @see http://php.net/fsockopen
41
+	 * @param string $hostname
42
+	 * @param int $port
43
+	 * @param int $errno
44
+	 * @param string $errstr
45
+	 * @param float $timeout
46
+	 * @return resource
47
+	 */
48
+	public function fsockopen($hostname, $port = -1, &$errno = 0, &$errstr = '', $timeout = null)
49
+	{
50
+		$this->handle = fsockopen($hostname, $port, $errno, $errstr, (is_null($timeout) ? ini_get("default_socket_timeout") : $timeout));
51 51
 
52
-        if ($this->handle != false && $errno === 0 && $errstr === '') {
53
-            return $this->handle;
54
-        } else {
55
-            return false;
56
-        }
57
-    }
52
+		if ($this->handle != false && $errno === 0 && $errstr === '') {
53
+			return $this->handle;
54
+		} else {
55
+			return false;
56
+		}
57
+	}
58 58
 
59
-    /**
60
-     * fwrite
61
-     * 
62
-     * @see http://php.net/fwrite
63
-     * @param string $string
64
-     * @param int $length
65
-     * @return int | bool
66
-     */
67
-    public function fwrite($string, $length = null)
68
-    {
69
-        return fwrite($this->handle, $string, (is_null($length) ? strlen($string) : $length));
70
-    }
59
+	/**
60
+	 * fwrite
61
+	 * 
62
+	 * @see http://php.net/fwrite
63
+	 * @param string $string
64
+	 * @param int $length
65
+	 * @return int | bool
66
+	 */
67
+	public function fwrite($string, $length = null)
68
+	{
69
+		return fwrite($this->handle, $string, (is_null($length) ? strlen($string) : $length));
70
+	}
71 71
 
72
-    /**
73
-     * fgets
74
-     * 
75
-     * @see http://php.net/fgets
76
-     * @param int $length
77
-     * @return string
78
-     */
79
-    public function fgets($length = null)
80
-    {
81
-        return fgets($this->handle, $length);
82
-    }
72
+	/**
73
+	 * fgets
74
+	 * 
75
+	 * @see http://php.net/fgets
76
+	 * @param int $length
77
+	 * @return string
78
+	 */
79
+	public function fgets($length = null)
80
+	{
81
+		return fgets($this->handle, $length);
82
+	}
83 83
 
84
-    /**
85
-     * feof
86
-     * 
87
-     * @see http://php.net/feof
88
-     * @return bool
89
-     */
90
-    public function feof()
91
-    {
92
-        return feof($this->handle);
93
-    }
84
+	/**
85
+	 * feof
86
+	 * 
87
+	 * @see http://php.net/feof
88
+	 * @return bool
89
+	 */
90
+	public function feof()
91
+	{
92
+		return feof($this->handle);
93
+	}
94 94
 
95
-    /**
96
-     * fclose
97
-     * 
98
-     * @see http://php.net/fclose
99
-     * @return bool
100
-     */
101
-    public function fclose()
102
-    {
103
-        return fclose($this->handle);
104
-    }
95
+	/**
96
+	 * fclose
97
+	 * 
98
+	 * @see http://php.net/fclose
99
+	 * @return bool
100
+	 */
101
+	public function fclose()
102
+	{
103
+		return fclose($this->handle);
104
+	}
105 105
 }
Please login to merge, or discard this patch.
Sources/ReCaptcha/ReCaptcha/RequestMethod/Post.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -34,37 +34,37 @@
 block discarded – undo
34 34
  */
35 35
 class Post implements RequestMethod
36 36
 {
37
-    /**
38
-     * URL to which requests are POSTed.
39
-     * @const string
40
-     */
41
-    const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify';
37
+	/**
38
+	 * URL to which requests are POSTed.
39
+	 * @const string
40
+	 */
41
+	const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify';
42 42
 
43
-    /**
44
-     * Submit the POST request with the specified parameters.
45
-     *
46
-     * @param RequestParameters $params Request parameters
47
-     * @return string Body of the reCAPTCHA response
48
-     */
49
-    public function submit(RequestParameters $params)
50
-    {
51
-        /**
52
-         * PHP 5.6.0 changed the way you specify the peer name for SSL context options.
53
-         * Using "CN_name" will still work, but it will raise deprecated errors.
54
-         */
55
-        $peer_key = version_compare(PHP_VERSION, '5.6.0', '<') ? 'CN_name' : 'peer_name';
56
-        $options = array(
57
-            'http' => array(
58
-                'header' => "Content-type: application/x-www-form-urlencoded\r\n",
59
-                'method' => 'POST',
60
-                'content' => $params->toQueryString(),
61
-                // Force the peer to validate (not needed in 5.6.0+, but still works
62
-                'verify_peer' => true,
63
-                // Force the peer validation to use www.google.com
64
-                $peer_key => 'www.google.com',
65
-            ),
66
-        );
67
-        $context = stream_context_create($options);
68
-        return file_get_contents(self::SITE_VERIFY_URL, false, $context);
69
-    }
43
+	/**
44
+	 * Submit the POST request with the specified parameters.
45
+	 *
46
+	 * @param RequestParameters $params Request parameters
47
+	 * @return string Body of the reCAPTCHA response
48
+	 */
49
+	public function submit(RequestParameters $params)
50
+	{
51
+		/**
52
+		 * PHP 5.6.0 changed the way you specify the peer name for SSL context options.
53
+		 * Using "CN_name" will still work, but it will raise deprecated errors.
54
+		 */
55
+		$peer_key = version_compare(PHP_VERSION, '5.6.0', '<') ? 'CN_name' : 'peer_name';
56
+		$options = array(
57
+			'http' => array(
58
+				'header' => "Content-type: application/x-www-form-urlencoded\r\n",
59
+				'method' => 'POST',
60
+				'content' => $params->toQueryString(),
61
+				// Force the peer to validate (not needed in 5.6.0+, but still works
62
+				'verify_peer' => true,
63
+				// Force the peer validation to use www.google.com
64
+				$peer_key => 'www.google.com',
65
+			),
66
+		);
67
+		$context = stream_context_create($options);
68
+		return file_get_contents(self::SITE_VERIFY_URL, false, $context);
69
+	}
70 70
 }
Please login to merge, or discard this patch.
Sources/ReCaptcha/ReCaptcha/RequestMethod/CurlPost.php 1 patch
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -36,53 +36,53 @@
 block discarded – undo
36 36
  */
37 37
 class CurlPost implements RequestMethod
38 38
 {
39
-    /**
40
-     * URL to which requests are sent via cURL.
41
-     * @const string
42
-     */
43
-    const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify';
39
+	/**
40
+	 * URL to which requests are sent via cURL.
41
+	 * @const string
42
+	 */
43
+	const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify';
44 44
 
45
-    /**
46
-     * Curl connection to the reCAPTCHA service
47
-     * @var Curl
48
-     */
49
-    private $curl;
45
+	/**
46
+	 * Curl connection to the reCAPTCHA service
47
+	 * @var Curl
48
+	 */
49
+	private $curl;
50 50
 
51
-    public function __construct(Curl $curl = null)
52
-    {
53
-        if (!is_null($curl)) {
54
-            $this->curl = $curl;
55
-        } else {
56
-            $this->curl = new Curl();
57
-        }
58
-    }
51
+	public function __construct(Curl $curl = null)
52
+	{
53
+		if (!is_null($curl)) {
54
+			$this->curl = $curl;
55
+		} else {
56
+			$this->curl = new Curl();
57
+		}
58
+	}
59 59
 
60
-    /**
61
-     * Submit the cURL request with the specified parameters.
62
-     *
63
-     * @param RequestParameters $params Request parameters
64
-     * @return string Body of the reCAPTCHA response
65
-     */
66
-    public function submit(RequestParameters $params)
67
-    {
68
-        $handle = $this->curl->init(self::SITE_VERIFY_URL);
60
+	/**
61
+	 * Submit the cURL request with the specified parameters.
62
+	 *
63
+	 * @param RequestParameters $params Request parameters
64
+	 * @return string Body of the reCAPTCHA response
65
+	 */
66
+	public function submit(RequestParameters $params)
67
+	{
68
+		$handle = $this->curl->init(self::SITE_VERIFY_URL);
69 69
 
70
-        $options = array(
71
-            CURLOPT_POST => true,
72
-            CURLOPT_POSTFIELDS => $params->toQueryString(),
73
-            CURLOPT_HTTPHEADER => array(
74
-                'Content-Type: application/x-www-form-urlencoded'
75
-            ),
76
-            CURLINFO_HEADER_OUT => false,
77
-            CURLOPT_HEADER => false,
78
-            CURLOPT_RETURNTRANSFER => true,
79
-            CURLOPT_SSL_VERIFYPEER => true
80
-        );
81
-        $this->curl->setoptArray($handle, $options);
70
+		$options = array(
71
+			CURLOPT_POST => true,
72
+			CURLOPT_POSTFIELDS => $params->toQueryString(),
73
+			CURLOPT_HTTPHEADER => array(
74
+				'Content-Type: application/x-www-form-urlencoded'
75
+			),
76
+			CURLINFO_HEADER_OUT => false,
77
+			CURLOPT_HEADER => false,
78
+			CURLOPT_RETURNTRANSFER => true,
79
+			CURLOPT_SSL_VERIFYPEER => true
80
+		);
81
+		$this->curl->setoptArray($handle, $options);
82 82
 
83
-        $response = $this->curl->exec($handle);
84
-        $this->curl->close($handle);
83
+		$response = $this->curl->exec($handle);
84
+		$this->curl->close($handle);
85 85
 
86
-        return $response;
87
-    }
86
+		return $response;
87
+	}
88 88
 }
Please login to merge, or discard this patch.
Sources/ReCaptcha/ReCaptcha/RequestMethod/Curl.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -32,43 +32,43 @@
 block discarded – undo
32 32
 class Curl
33 33
 {
34 34
 
35
-    /**
36
-     * @see http://php.net/curl_init
37
-     * @param string $url
38
-     * @return resource cURL handle
39
-     */
40
-    public function init($url = null)
41
-    {
42
-        return curl_init($url);
43
-    }
35
+	/**
36
+	 * @see http://php.net/curl_init
37
+	 * @param string $url
38
+	 * @return resource cURL handle
39
+	 */
40
+	public function init($url = null)
41
+	{
42
+		return curl_init($url);
43
+	}
44 44
 
45
-    /**
46
-     * @see http://php.net/curl_setopt_array
47
-     * @param resource $ch
48
-     * @param array $options
49
-     * @return bool
50
-     */
51
-    public function setoptArray($ch, array $options)
52
-    {
53
-        return curl_setopt_array($ch, $options);
54
-    }
45
+	/**
46
+	 * @see http://php.net/curl_setopt_array
47
+	 * @param resource $ch
48
+	 * @param array $options
49
+	 * @return bool
50
+	 */
51
+	public function setoptArray($ch, array $options)
52
+	{
53
+		return curl_setopt_array($ch, $options);
54
+	}
55 55
 
56
-    /**
57
-     * @see http://php.net/curl_exec
58
-     * @param resource $ch
59
-     * @return mixed
60
-     */
61
-    public function exec($ch)
62
-    {
63
-        return curl_exec($ch);
64
-    }
56
+	/**
57
+	 * @see http://php.net/curl_exec
58
+	 * @param resource $ch
59
+	 * @return mixed
60
+	 */
61
+	public function exec($ch)
62
+	{
63
+		return curl_exec($ch);
64
+	}
65 65
 
66
-    /**
67
-     * @see http://php.net/curl_close
68
-     * @param resource $ch
69
-     */
70
-    public function close($ch)
71
-    {
72
-        curl_close($ch);
73
-    }
66
+	/**
67
+	 * @see http://php.net/curl_close
68
+	 * @param resource $ch
69
+	 */
70
+	public function close($ch)
71
+	{
72
+		curl_close($ch);
73
+	}
74 74
 }
Please login to merge, or discard this patch.
Themes/default/Calendar.template.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -253,9 +253,9 @@  discard block
 block discarded – undo
253 253
 					{
254 254
 						// Sort events by start time (all day events will be listed first)
255 255
 						uasort($day['events'], function ($a, $b) {
256
-						    if ($a['start_timestamp'] == $b['start_timestamp'])
257
-						        return 0;
258
-						    return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1;
256
+							if ($a['start_timestamp'] == $b['start_timestamp'])
257
+								return 0;
258
+							return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1;
259 259
 						});
260 260
 
261 261
 						echo '
@@ -436,9 +436,9 @@  discard block
 block discarded – undo
436 436
 							{
437 437
 								// Sort events by start time (all day events will be listed first)
438 438
 								uasort($day['events'], function ($a, $b) {
439
-								    if ($a['start_timestamp'] == $b['start_timestamp'])
440
-								        return 0;
441
-								    return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1;
439
+									if ($a['start_timestamp'] == $b['start_timestamp'])
440
+										return 0;
441
+									return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1;
442 442
 								});
443 443
 
444 444
 								foreach ($day['events'] as $event)
Please login to merge, or discard this patch.
Sources/ManageBans.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 		)
785 785
 	);
786 786
 	while ($row = $smcFunc['db_fetch_assoc']($request))
787
-	    $error_ips[] = inet_dtop($row['ip']);
787
+		$error_ips[] = inet_dtop($row['ip']);
788 788
 	$smcFunc['db_free_result']($request);
789 789
 
790 790
 	return $error_ips;
@@ -2168,9 +2168,9 @@  discard block
 block discarded – undo
2168 2168
 
2169 2169
 	if ($low == '255.255.255.255') return 'unknown';
2170 2170
 	if ($low == $high)
2171
-	    return $low;
2171
+		return $low;
2172 2172
 	else
2173
-	    return $low . '-' . $high;
2173
+		return $low . '-' . $high;
2174 2174
 }
2175 2175
 
2176 2176
 /**
Please login to merge, or discard this patch.
Sources/Who.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -673,7 +673,7 @@
 block discarded – undo
673 673
 						'Nikola &quot;Dzonny&quot; Novakovi&cacute;',
674 674
 						// Localizers
675 675
 						'Dr. Deejay',
676
-                        			'd3vcho',
676
+									'd3vcho',
677 677
 						// Former Localizers
678 678
 						'Relyana',
679 679
 					),
Please login to merge, or discard this patch.