Completed
Push — master ( 4a8418...a8d532 )
by mains
03:04
created
templates/header.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -1,53 +1,53 @@
 block discarded – undo
1 1
 <!DOCTYPE html>
2 2
 <html lang="en">
3 3
 	<head>
4
-		<title><?php echo $title;?></title>
4
+		<title><?php echo $title; ?></title>
5 5
 		
6 6
 		<meta charset="utf-8">
7 7
 		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
8 8
 		<meta http-equiv="x-ua-compatible" content="ie=edge">
9 9
 		
10
-		<meta name="description" content="<?php echo $description;?>">
10
+		<meta name="description" content="<?php echo $description; ?>">
11 11
 		<meta name="keywords" content="jodelblue, jodel, blue, webclient, web, client, web-app, browser, app">
12 12
 		
13 13
 		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
14 14
 		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.1.1/ekko-lightbox.min.css" integrity="sha256-8aNQFtmxcOMVoOhLD4mrHqaKC2Ui++LmlQsoKTqxwIE=" crossorigin="anonymous" />
15
-		<link rel="stylesheet" href="<?php echo $baseUrl;?>css/font-awesome.min.css">
16
-		<link rel="stylesheet" href="<?php echo $baseUrl;?>style.css" type="text/css">
15
+		<link rel="stylesheet" href="<?php echo $baseUrl; ?>css/font-awesome.min.css">
16
+		<link rel="stylesheet" href="<?php echo $baseUrl; ?>style.css" type="text/css">
17 17
 		
18
-		<link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico">
19
-		<link rel="icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico">
20
-		<link rel="icon" type="image/gif" href="<?php echo $baseUrl;?>img/favicon/favicon.gif">
21
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon.png">
22
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon.png">
23
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57">
24
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60">
25
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72">
26
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76">
27
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114">
28
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120">
29
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128">
30
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144">
31
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152">
32
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180">
33
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-precomposed.png">
34
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-16x16.png" sizes="16x16">
35
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-32x32.png" sizes="32x32">
36
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-96x96.png" sizes="96x96">
37
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-160x160.png" sizes="160x160">
38
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-192x192.png" sizes="192x192">
39
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-196x196.png" sizes="196x196">
40
-		<meta name="msapplication-TileImage" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> 
18
+		<link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico">
19
+		<link rel="icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico">
20
+		<link rel="icon" type="image/gif" href="<?php echo $baseUrl; ?>img/favicon/favicon.gif">
21
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon.png">
22
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon.png">
23
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57">
24
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60">
25
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72">
26
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76">
27
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114">
28
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120">
29
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128">
30
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144">
31
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152">
32
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180">
33
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-precomposed.png">
34
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-16x16.png" sizes="16x16">
35
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-32x32.png" sizes="32x32">
36
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-96x96.png" sizes="96x96">
37
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-160x160.png" sizes="160x160">
38
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-192x192.png" sizes="192x192">
39
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-196x196.png" sizes="196x196">
40
+		<meta name="msapplication-TileImage" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> 
41 41
 		<meta name="msapplication-TileColor" content="#5682a3"> 
42 42
 		<meta name="msapplication-navbutton-color" content="#5682a3"> 
43 43
 		<meta name="application-name" content="JodelBlue"/> 
44 44
 		<meta name="msapplication-tooltip" content="JodelBlue"/> 
45 45
 		<meta name="apple-mobile-web-app-title" content="JodelBlue"/> 
46
-		<meta name="msapplication-square70x70logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-70x70.png"> 
47
-		<meta name="msapplication-square144x144logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> 
48
-		<meta name="msapplication-square150x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-150x150.png"> 
49
-		<meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x150.png"> 
50
-		<meta name="msapplication-square310x310logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x310.png"> 
46
+		<meta name="msapplication-square70x70logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-70x70.png"> 
47
+		<meta name="msapplication-square144x144logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> 
48
+		<meta name="msapplication-square150x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-150x150.png"> 
49
+		<meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x150.png"> 
50
+		<meta name="msapplication-square310x310logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x310.png"> 
51 51
 	</head>
52 52
 
53 53
 	<body>
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 				</article>
105 105
 			
106 106
 				<aside class="topSidebar col-sm-4 sidebar-outer">
107
-					<div class="fixed<?php if(!$view->isDetailedView) echo(' hide-mobile');?>">
107
+					<div class="fixed<?php if(!$view->isDetailedView) echo(' hide-mobile'); ?>">
108 108
 						<article>
109 109
 							<div>
110 110
 								<h2>Position / Hashtag</h2>
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 									if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) { ?>
142 142
 									<h2>Comment on Jodel</h2>
143 143
 									<form method="POST">				
144
-											<input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']);?>" />
144
+											<input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']); ?>" />
145 145
 											<textarea id="message" name="message" placeholder="Send a comment on a Jodel to all students within 10km" required></textarea> 
146 146
 										<br />
147 147
 										<input type="submit" value="SEND" /> 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 					</div>
204 204
 				</aside>
205 205
 			</div>
206
-			<?php include 'templates/nav-bottom.php';?>
206
+			<?php include 'templates/nav-bottom.php'; ?>
207 207
 		</div>
208 208
 		<?php
209 209
 			$includeEmojiAndAjax = TRUE;
Please login to merge, or discard this patch.
templates/footer.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 			  crossorigin="anonymous"></script>
6 6
 	    <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
7 7
 	    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
8
-	    <script src="<?php echo $baseUrl;?>js/jQueryEmoji.js"></script>
8
+	    <script src="<?php echo $baseUrl; ?>js/jQueryEmoji.js"></script>
9 9
 	    <script src="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.1.1/ekko-lightbox.min.js" integrity="sha256-1odJPEl+KoMUaA1T7QNMGSSU/r5LCKCRC6SL8P0r2gY=" crossorigin="anonymous"></script>
10 10
 
11 11
 		<script>
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 			console.log(solution);
38 38
 			$.ajax({
39 39
 			  type: "POST",
40
-			  url: "<?php echo $baseUrl;?>vote-ajax.php?solution=" + solution + "&key="+key,
40
+			  url: "<?php echo $baseUrl; ?>vote-ajax.php?solution=" + solution + "&key="+key,
41 41
 			  data: {"deviceUid" : deviceUid},
42 42
 			  success: function(result){
43 43
 				  	var response = JSON.parse(result);
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
 			{
62 62
 				window.history.back();
63 63
 			}
64
-		<?php if(isset($includeEmojiAndAjax)){ ?>
64
+		<?php if(isset($includeEmojiAndAjax)) { ?>
65 65
 
66 66
 			function vote(postId, vote, obj)
67 67
 			{
68 68
 				$.ajax({
69
-					url: '<?php echo $baseUrl;?>vote-ajax.php?postId=' + postId + '&vote=' + vote,
69
+					url: '<?php echo $baseUrl; ?>vote-ajax.php?postId=' + postId + '&vote=' + vote,
70 70
 					dataType: 'json',
71 71
 					async: true,
72 72
 					success: function(json)
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
 			{
94 94
 				<?php if(isset($errorMsg)) { ?>
95 95
 				//Error Msg
96
-				if('<?php echo $errorMsg;?>' != '')
96
+				if('<?php echo $errorMsg; ?>' != '')
97 97
 				{
98
-					alert('<?php echo $errorMsg;?>');
98
+					alert('<?php echo $errorMsg; ?>');
99 99
 				}
100 100
 				<?php } ?>
101 101
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 				function getMorePosts(lastPostId, view, hashtag, old_lastPostId)
129 129
 				{
130 130
 					$.ajax({
131
-						url: '<?php echo $baseUrl;?>get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view + '&hashtag=' + encodeURIComponent(hashtag),
131
+						url: '<?php echo $baseUrl; ?>get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view + '&hashtag=' + encodeURIComponent(hashtag),
132 132
 						dataType: 'html',
133 133
 						async: false,
134 134
 						success: function(html) {
Please login to merge, or discard this patch.
php/Requests/AbstractRequest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         $header = $this->getSignHeaders();
30 30
         $url = $this->getFullUrl();
31 31
 
32
-        if ($this->getAccessToken()) {
32
+        if($this->getAccessToken()) {
33 33
             $header['Authorization'] = "Bearer " . $this->getAccessToken();
34 34
         }
35 35
         //Comment out to debug the Request:
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             'proxy' => '186.103.169.165:8080',
53 53
         );*/
54 54
 
55
-        switch ($this->getMethod()) {
55
+        switch($this->getMethod()) {
56 56
             case 'POST':
57 57
                 $result = Requests::post($url, $header, $this->payLoad);
58 58
                 break;
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
         http_response_code($result->status_code);
75 75
 
76
-        switch ($result->status_code) {
76
+        switch($result->status_code) {
77 77
             case 200:
78 78
                 $result = json_decode($result->body, true);
79 79
                 break;
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             case 502:
117 117
                 error_log('Error 502 - ' . print_r($result, true));
118 118
                 $result = json_decode($result->body, true);
119
-                header('location:'.$_SERVER['PHP_SELF']);
119
+                header('location:' . $_SERVER['PHP_SELF']);
120 120
                 break;
121 121
             case 503:
122 122
                 error_log('Error 503 - ' . print_r($result, true));
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
 
125 125
                 if(array_key_exists('error', $result) && $result['error'] == 'Service Unavailable')
126 126
                 {
127
-                    header('location:'.$_SERVER['PHP_SELF']); 
127
+                    header('location:' . $_SERVER['PHP_SELF']); 
128 128
                 }
129 129
                 break;
130 130
             default:
131
-                error_log('Error '.$result->status_code.' - unknown error');
131
+                error_log('Error ' . $result->status_code . ' - unknown error');
132 132
                 $result = json_decode($result->body, true);
133 133
         }
134 134
 
Please login to merge, or discard this patch.
php/View.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -63,25 +63,25 @@  discard block
 block discarded – undo
63 63
         $timediff_inDays = (string)$timediff->format('%d');
64 64
         $timediff_inMonth = (string)$timediff->format('%m');
65 65
 
66
-        if($timediff_inMonth!=0)
66
+        if($timediff_inMonth != 0)
67 67
         {
68 68
                 $timediff = $timediff_inMonth . "m";
69 69
         }
70 70
         else
71 71
         {
72
-            if($timediff_inDays!=0)
72
+            if($timediff_inDays != 0)
73 73
             {
74 74
                 $timediff = $timediff_inDays . "d";
75 75
             }
76 76
             else
77 77
             {
78
-                if($timediff_inHours!=0)
78
+                if($timediff_inHours != 0)
79 79
                 {
80 80
                     $timediff = $timediff_inHours . "h";
81 81
                 }
82 82
                 else
83 83
                 {
84
-                    if($timediff_inMinutes!=0)
84
+                    if($timediff_inMinutes != 0)
85 85
                     {
86 86
                         $timediff = $timediff_inMinutes . "m";
87 87
                     }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
 
97 97
         ?>
98
-        <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color'];?>;">
98
+        <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color']; ?>;">
99 99
             <content>
100 100
                 <?php 
101 101
                 if(isset($post['image_url']))
@@ -110,12 +110,12 @@  discard block
 block discarded – undo
110 110
                 ?>
111 111
             </content>
112 112
             <aside>                    
113
-                <button onclick="vote('<?php echo $post['post_id'];?>', 'up', this)">
113
+                <button onclick="vote('<?php echo $post['post_id']; ?>', 'up', this)">
114 114
                     <i class="fa fa-angle-up fa-3x"></i>
115 115
                 </button>    
116
-                <br><span><?php echo $post["vote_count"];?></span><br>
116
+                <br><span><?php echo $post["vote_count"]; ?></span><br>
117 117
 
118
-                <button onclick="vote('<?php echo $post['post_id'];?>', 'down', this)">
118
+                <button onclick="vote('<?php echo $post['post_id']; ?>', 'down', this)">
119 119
                     <i class="fa fa-angle-down fa-3x"></i>
120 120
                 </button>
121 121
             </aside>
@@ -126,14 +126,14 @@  discard block
 block discarded – undo
126 126
                         <span class="time">
127 127
                             <span class="tip" data-tooltip="Time">
128 128
                                 <i class="fa fa-clock-o"></i>
129
-                                <?php echo $timediff;?>
130
-                                <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span>
129
+                                <?php echo $timediff; ?>
130
+                                <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s'); ?></span>
131 131
                             </span> 
132 132
                         </span>
133 133
 						<?php if(!$this->isDetailedView) {?>
134 134
                         <span class="comments">
135 135
                             <span data-tooltip="Comments">
136
-                                <a href="<?php echo $this->changePostId($post['post_id'])->toUrl();?>">
136
+                                <a href="<?php echo $this->changePostId($post['post_id'])->toUrl(); ?>">
137 137
                                     <i class="fa fa-commenting-o"></i>
138 138
                                     <?php if(array_key_exists("child_count", $post))
139 139
                                     {
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
                                         {
177 177
                                             ?>
178 178
                                             <span data-tooltip="Author">
179
-                                                <i class="fa fa-user-o"></i> #<?php echo $post['user_handle'];?> |
179
+                                                <i class="fa fa-user-o"></i> #<?php echo $post['user_handle']; ?> |
180 180
                                             </span>
181 181
                                             <?php
182 182
                                         }
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
 
187 187
                             <span class="tip" data-tooltip="Distance">
188 188
                                 <i class="fa fa-map-marker"></i>
189
-                                <?php echo $post['distance'];?> km
190
-                                <span class="tiptext"><?php echo $post['location']['name'];?></span>
189
+                                <?php echo $post['distance']; ?> km
190
+                                <span class="tiptext"><?php echo $post['location']['name']; ?></span>
191 191
                             </span>
192 192
                         </span>
193 193
                     
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
 		if($post != '' && array_key_exists('message', $post) && $post['message'] != '' && $this->isDetailedView)
228 228
 		{
229
-			$description = 'On JodelBlue in ' . htmlspecialchars($this->city) .  ' with ' . htmlspecialchars($post['vote_count']) . ' Upvotes: ' . substr(htmlspecialchars($post['message']), 0, 130);
229
+			$description = 'On JodelBlue in ' . htmlspecialchars($this->city) . ' with ' . htmlspecialchars($post['vote_count']) . ' Upvotes: ' . substr(htmlspecialchars($post['message']), 0, 130);
230 230
 		}
231 231
 
232 232
 		return $description;
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
         {
329 329
             return $data['recent'];
330 330
         }
331
-        else if(array_key_exists('posts', $data)&& array_key_exists(0, $data['posts']))
331
+        else if(array_key_exists('posts', $data) && array_key_exists(0, $data['posts']))
332 332
         {
333 333
             return $data['posts'];
334 334
         }
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
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 
22 22
 if(!$userIsVoter && !$userIsAdmin)
23 23
 {
24
-	error_log($_SERVER['REMOTE_ADDR']  . ' used a wrong password on vote-ajax.php');
25
-	$response = array("message" => $_SERVER['REMOTE_ADDR']  . ' used a wrong password on vote-ajax.php',"success" => false);
24
+	error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php');
25
+	$response = array("message" => $_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php', "success" => false);
26 26
 	echo json_encode($response);
27 27
 	die();
28 28
 }
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 			}
142 142
 		}
143 143
 
144
-	if (isset($captcha))
144
+	if(isset($captcha))
145 145
 	{
146 146
 		$response = array("success" => $success, "message" => $message, "captcha" => $captcha, "deviceUid" => $deviceUid);
147 147
 	}
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("j.n.Y") . '.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.
php/DatabaseConnect.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@
 block discarded – undo
17 17
 {
18 18
 	error_log('ER_TOO_MANY_USER_CONNECTIONS');
19 19
 	sleep(1);
20
-	header('location: '.$_SERVER['PHP_SELF']);
20
+	header('location: ' . $_SERVER['PHP_SELF']);
21 21
 }
22 22
 
23
-if ($db->connect_errno)
23
+if($db->connect_errno)
24 24
 {
25 25
 	error_log('Sorry, die Verbindung zu unserem 
26 26
         Server ist hops gegangen. Wegen '. $db -> connect_error);
Please login to merge, or discard this patch.
admin.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@  discard block
 block discarded – undo
5 5
 
6 6
 if(isset($_GET['pw']))
7 7
 {
8
-	setcookie('JodelAdminPassword', $_GET['pw'], time()+60*60*24*365*10);
8
+	setcookie('JodelAdminPassword', $_GET['pw'], time() + 60 * 60 * 24 * 365 * 10);
9 9
 	error_log('admin password saved for [' . $_SERVER ['HTTP_USER_AGENT'] . ']');
10 10
 	header('Location: ' . $baseUrl . 'admin.php');
11 11
 	exit;
12 12
 }
13 13
 else if(isset($_GET['voterPw']))
14 14
 {
15
-	setcookie('JodelVoterPassword', $_GET['voterPw'], time()+60*60*24*365*10);
15
+	setcookie('JodelVoterPassword', $_GET['voterPw'], time() + 60 * 60 * 24 * 365 * 10);
16 16
 	error_log('voter password saved for [' . $_SERVER ['HTTP_USER_AGENT'] . ']');
17 17
 	header('Location: ' . $baseUrl);
18 18
 	exit;
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 }
43 43
 else
44 44
 {
45
-	error_log($_SERVER['REMOTE_ADDR']  . ' used a wrong voterPw / pw on admin.php');
45
+	error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong voterPw / pw on admin.php');
46 46
 	die();
47 47
 }
48 48
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
                     	. "','" . $db->escape_string($_POST['device_uid'])
63 63
                     	. "','" . $db->escape_string($_POST['rights']) . "')");
64 64
     
65
-    if($result === false){
65
+    if($result === false) {
66 66
             $error = db_error();
67 67
             error_log($error);
68 68
             error_log("Adding Voter failed: (" . $result->errno . ") " . $result->error);
@@ -110,42 +110,42 @@  discard block
 block discarded – undo
110 110
 		<meta name="keywords" content="jodelblue, jodel, blue, webclient, web, client">
111 111
 		
112 112
 		<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">
113
-				<link rel="stylesheet" href="<?php echo $baseUrl;?>css/font-awesome.min.css">
114
-		<link rel="stylesheet" href="<?php echo $baseUrl;?>style.css" type="text/css">
113
+				<link rel="stylesheet" href="<?php echo $baseUrl; ?>css/font-awesome.min.css">
114
+		<link rel="stylesheet" href="<?php echo $baseUrl; ?>style.css" type="text/css">
115 115
 		
116
-		<link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico">
117
-		<link rel="icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico">
118
-		<link rel="icon" type="image/gif" href="<?php echo $baseUrl;?>img/favicon/favicon.gif">
119
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon.png">
120
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon.png">
121
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57">
122
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60">
123
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72">
124
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76">
125
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114">
126
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120">
127
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128">
128
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144">
129
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152">
130
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180">
131
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-precomposed.png">
132
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-16x16.png" sizes="16x16">
133
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-32x32.png" sizes="32x32">
134
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-96x96.png" sizes="96x96">
135
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-160x160.png" sizes="160x160">
136
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-192x192.png" sizes="192x192">
137
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-196x196.png" sizes="196x196">
138
-		<meta name="msapplication-TileImage" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> 
116
+		<link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico">
117
+		<link rel="icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico">
118
+		<link rel="icon" type="image/gif" href="<?php echo $baseUrl; ?>img/favicon/favicon.gif">
119
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon.png">
120
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon.png">
121
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57">
122
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60">
123
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72">
124
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76">
125
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114">
126
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120">
127
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128">
128
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144">
129
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152">
130
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180">
131
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-precomposed.png">
132
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-16x16.png" sizes="16x16">
133
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-32x32.png" sizes="32x32">
134
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-96x96.png" sizes="96x96">
135
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-160x160.png" sizes="160x160">
136
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-192x192.png" sizes="192x192">
137
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-196x196.png" sizes="196x196">
138
+		<meta name="msapplication-TileImage" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> 
139 139
 		<meta name="msapplication-TileColor" content="#5682a3"> 
140 140
 		<meta name="msapplication-navbutton-color" content="#5682a3"> 
141 141
 		<meta name="application-name" content="JodelBlue"/> 
142 142
 		<meta name="msapplication-tooltip" content="JodelBlue"/> 
143 143
 		<meta name="apple-mobile-web-app-title" content="JodelBlue"/> 
144
-		<meta name="msapplication-square70x70logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-70x70.png"> 
145
-		<meta name="msapplication-square144x144logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> 
146
-		<meta name="msapplication-square150x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-150x150.png"> 
147
-		<meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x150.png"> 
148
-		<meta name="msapplication-square310x310logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x310.png"> 
144
+		<meta name="msapplication-square70x70logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-70x70.png"> 
145
+		<meta name="msapplication-square144x144logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> 
146
+		<meta name="msapplication-square150x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-150x150.png"> 
147
+		<meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x150.png"> 
148
+		<meta name="msapplication-square310x310logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x310.png"> 
149 149
 	</head>
150 150
 	
151 151
 	<body>
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 						?>
218 218
 							<div class="row">								
219 219
 								<div class="col-12 col-sm-12">
220
-								<h2>Voting (<?php echo $votesRemaining;?> votes remaining)</h2>
220
+								<h2>Voting (<?php echo $votesRemaining; ?> votes remaining)</h2>
221 221
 									<form>
222 222
 										<div class="form-group">
223 223
 											<label for="quantityDelay">Quantity</label>
@@ -226,20 +226,20 @@  discard block
 block discarded – undo
226 226
 										<div class="form-group">
227 227
 											<label for="minDelay">Minimum delay</label>
228 228
 											<div class="input-group">
229
-												<input placeholder="min interval" class="form-control" id="minDelay" value="<?php echo $config['minInterval'];?>" type="number" name="min">
229
+												<input placeholder="min interval" class="form-control" id="minDelay" value="<?php echo $config['minInterval']; ?>" type="number" name="min">
230 230
 												<span class="input-group-addon">seconds</span>
231 231
 											</div>
232 232
 										</div>
233 233
 										<div class="form-group">
234 234
 											<label for="maxDelay">Maximum delay</label>
235 235
 											<div class="input-group">
236
-												<input placeholder="max interval" class="form-control" id="maxDelay" value="<?php echo $config['maxInterval'];?>" type="number" name="max">
236
+												<input placeholder="max interval" class="form-control" id="maxDelay" value="<?php echo $config['maxInterval']; ?>" type="number" name="max">
237 237
 												<span class="input-group-addon">seconds</span>
238 238
 											</div>
239 239
 										</div>
240 240
 										<div class="form-group">
241 241
 											<label for="postIdDelay">Post Id</label>
242
-											<input placeholder="postId" class="form-control" id="postIdDelay" value="<?php if(isset($_GET['postId'])) echo $_GET['postId'];?>" type="text" name="postId">
242
+											<input placeholder="postId" class="form-control" id="postIdDelay" value="<?php if(isset($_GET['postId'])) echo $_GET['postId']; ?>" type="text" name="postId">
243 243
 										</div>
244 244
 										<div class="row">
245 245
 											<div class="col-6 col-xs-6"><button type="button" name="vote" value="up" class="half" onclick="voteWithAjax('up');">Upvote</button></div>
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 			  crossorigin="anonymous"></script>
266 266
 	    <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
267 267
 	    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
268
-	    <script src="<?php echo $baseUrl;?>js/jQueryEmoji.js"></script>
268
+	    <script src="<?php echo $baseUrl; ?>js/jQueryEmoji.js"></script>
269 269
 	    <script src="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.1.1/ekko-lightbox.min.js" integrity="sha256-1odJPEl+KoMUaA1T7QNMGSSU/r5LCKCRC6SL8P0r2gY=" crossorigin="anonymous"></script>
270 270
 
271 271
 		<script>
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 			{
310 310
 				$.ajax({
311 311
 				  type: "POST",
312
-				  url: "<?php echo $baseUrl;?>vote-ajax.php",
312
+				  url: "<?php echo $baseUrl; ?>vote-ajax.php",
313 313
 				  data: {"vote" : data["vote"],
314 314
 						 "postId" : data["id"]},
315 315
 				  success: function(result){
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 				console.log(solution);
364 364
 				$.ajax({
365 365
 				  type: "POST",
366
-				  url: "<?php echo $baseUrl;?>vote-ajax.php?solution=" + solution + "&key="+key,
366
+				  url: "<?php echo $baseUrl; ?>vote-ajax.php?solution=" + solution + "&key="+key,
367 367
 				  data: {"deviceUid" : deviceUid},
368 368
 				  success: function(result){
369 369
 					  var response = JSON.parse(result);
Please login to merge, or discard this patch.