Completed
Push — master ( ea693b...e34205 )
by mains
03:07
created
error-pages/404.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,4 +66,4 @@
 block discarded – undo
66 66
 	</div>
67 67
 
68 68
 </div>
69
-<?php include(realpath(__DIR__ . '/..') . '/templates/footer.php');?>
70 69
\ No newline at end of file
70
+<?php include(realpath(__DIR__ . '/..') . '/templates/footer.php'); ?>
71 71
\ No newline at end of file
Please login to merge, or discard this patch.
php/jodel-web.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
 function user_log($msg)
51 51
 {
52
-    $log  = $msg . PHP_EOL;
52
+    $log = $msg . PHP_EOL;
53 53
     file_put_contents(realpath(__DIR__ . '/..') . '/logs/user_log-' . date("Y.n.j") . '.txt', $log, FILE_APPEND);
54 54
 }
55 55
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 {
58 58
     preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches);
59 59
 
60
-    return (isset($matches[0])) ? true : false;
60
+    return (isset($matches[0]))?true : false;
61 61
 }
62 62
 
63 63
 function configPropertyExists($config, $property)
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 function isUserAdmin()
99 99
 {
100 100
 	global $config;
101
-	if (isset($_COOKIE['JodelAdminPassword']) && configPropertyExists($config, 'pw') && $config['pw'] == $_COOKIE['JodelAdminPassword'])
101
+	if(isset($_COOKIE['JodelAdminPassword']) && configPropertyExists($config, 'pw') && $config['pw'] == $_COOKIE['JodelAdminPassword'])
102 102
 	{
103 103
 		return TRUE;
104 104
 	}
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
 function isDeviceUidInDatabase($deviceUid)
112 112
 {
113 113
     $db = new DatabaseConnect();  
114
-    $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid  . "'");
114
+    $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'");
115 115
 
116
-    if ($result->num_rows > 0)
116
+    if($result->num_rows > 0)
117 117
     {
118 118
     	$db->close();
119 119
         return TRUE;
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
 		if(!isset($_COOKIE['JodelDeviceId']) || !isDeviceUidInDatabase($_COOKIE['JodelDeviceId']))
138 138
 		{
139 139
 			$jodelAccountForView = new JodelAccount();
140
-			setcookie('JodelDeviceId', $jodelAccountForView->deviceUid, time()+60*60*24*365*10);
141
-			user_log('Created account with JodelDeviceId:' . $jodelAccountForView->deviceUid .  ' for [' . $_SERVER ['HTTP_USER_AGENT'] . ']');
140
+			setcookie('JodelDeviceId', $jodelAccountForView->deviceUid, time() + 60 * 60 * 24 * 365 * 10);
141
+			user_log('Created account with JodelDeviceId:' . $jodelAccountForView->deviceUid . ' for [' . $_SERVER ['HTTP_USER_AGENT'] . ']');
142 142
 			
143 143
 		}
144 144
 		else
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	if(isset($_GET['search']))
168 168
 	{
169 169
 
170
-		user_log('User with JodelDeviceId:' . $jodelAccountForView->deviceUid .  ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] searched for ' . $_GET['search']);
170
+		user_log('User with JodelDeviceId:' . $jodelAccountForView->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] searched for ' . $_GET['search']);
171 171
 
172 172
 		if(substr($_GET['search'], 0, 1) === "#")
173 173
 		{
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 	
223 223
 	if(isset($_GET['view']))
224 224
 	{
225
-		switch ($_GET['view']) {
225
+		switch($_GET['view']) {
226 226
 			case 'discussed':
227 227
 				$view = 'discussed';
228 228
 				break;
Please login to merge, or discard this patch.