Completed
Push — master ( 769cd4...335df2 )
by mains
02:46
created
templates/footer.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@
 block discarded – undo
129 129
 		<?php  
130 130
 			if(is_file(realpath(__DIR__ . '/..') . '/piwik-script.html'))
131 131
 			{
132
-			    include(realpath(__DIR__ . '/..') . '/piwik-script.html');
132
+				include(realpath(__DIR__ . '/..') . '/piwik-script.html');
133 133
 			}
134 134
 		?>
135 135
 
Please login to merge, or discard this 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.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,7 +61,9 @@  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
+{
66
+?>
65 67
 
66 68
 			function vote(postId, vote, obj)
67 69
 			{
@@ -91,7 +93,9 @@  discard block
 block discarded – undo
91 93
 
92 94
 			$(document).ready(function()
93 95
 			{
94
-				<?php if(isset($errorMsg)) { ?>
96
+				<?php if(isset($errorMsg))
97
+{
98
+?>
95 99
 				//Error Msg
96 100
 				if('<?php echo $errorMsg;?>' != '')
97 101
 				{
@@ -155,7 +159,9 @@  discard block
 block discarded – undo
155 159
 					return {"lastPostId":lastPostId, "old_lastPostId":old_lastPostId};
156 160
 				}
157 161
 
158
-				<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?>
162
+				<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails']))
163
+{
164
+?>
159 165
 
160 166
 				if(window.location.hash)
161 167
 				{
Please login to merge, or discard this patch.
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
 		</article>
67 67
 	</div>
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.
error-pages/410.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
 		</article>
67 67
 	</div>
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.
admin.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -4,12 +4,12 @@  discard block
 block discarded – undo
4 4
 
5 5
 if((!isset($_GET['pw']) || $config['pw'] != $_GET['pw']) && !isUserAdmin())
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
-else if (isset($_GET['pw']))
10
+else if(isset($_GET['pw']))
11 11
 {
12
-	setcookie('JodelAdminPassword', $_GET['pw'], time()+60*60*24*365*10);
12
+	setcookie('JodelAdminPassword', $_GET['pw'], time() + 60 * 60 * 24 * 365 * 10);
13 13
 	error_log('admin password saved for [' . $_SERVER ['HTTP_USER_AGENT'] . ']');
14 14
 }
15 15
 
@@ -61,42 +61,42 @@  discard block
 block discarded – undo
61 61
 		<meta name="keywords" content="jodelblue, jodel, blue, webclient, web, client">
62 62
 		
63 63
 		<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">
64
-				<link rel="stylesheet" href="<?php echo $baseUrl;?>css/font-awesome.min.css">
65
-		<link rel="stylesheet" href="<?php echo $baseUrl;?>style.css" type="text/css">
64
+				<link rel="stylesheet" href="<?php echo $baseUrl; ?>css/font-awesome.min.css">
65
+		<link rel="stylesheet" href="<?php echo $baseUrl; ?>style.css" type="text/css">
66 66
 		
67
-		<link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico">
68
-		<link rel="icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico">
69
-		<link rel="icon" type="image/gif" href="<?php echo $baseUrl;?>img/favicon/favicon.gif">
70
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon.png">
71
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon.png">
72
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57">
73
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60">
74
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72">
75
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76">
76
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114">
77
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120">
78
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128">
79
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144">
80
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152">
81
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180">
82
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-precomposed.png">
83
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-16x16.png" sizes="16x16">
84
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-32x32.png" sizes="32x32">
85
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-96x96.png" sizes="96x96">
86
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-160x160.png" sizes="160x160">
87
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-192x192.png" sizes="192x192">
88
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-196x196.png" sizes="196x196">
89
-		<meta name="msapplication-TileImage" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> 
67
+		<link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico">
68
+		<link rel="icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico">
69
+		<link rel="icon" type="image/gif" href="<?php echo $baseUrl; ?>img/favicon/favicon.gif">
70
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon.png">
71
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon.png">
72
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57">
73
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60">
74
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72">
75
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76">
76
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114">
77
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120">
78
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128">
79
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144">
80
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152">
81
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180">
82
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-precomposed.png">
83
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-16x16.png" sizes="16x16">
84
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-32x32.png" sizes="32x32">
85
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-96x96.png" sizes="96x96">
86
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-160x160.png" sizes="160x160">
87
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-192x192.png" sizes="192x192">
88
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-196x196.png" sizes="196x196">
89
+		<meta name="msapplication-TileImage" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> 
90 90
 		<meta name="msapplication-TileColor" content="#5682a3"> 
91 91
 		<meta name="msapplication-navbutton-color" content="#5682a3"> 
92 92
 		<meta name="application-name" content="JodelBlue"/> 
93 93
 		<meta name="msapplication-tooltip" content="JodelBlue"/> 
94 94
 		<meta name="apple-mobile-web-app-title" content="JodelBlue"/> 
95
-		<meta name="msapplication-square70x70logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-70x70.png"> 
96
-		<meta name="msapplication-square144x144logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> 
97
-		<meta name="msapplication-square150x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-150x150.png"> 
98
-		<meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x150.png"> 
99
-		<meta name="msapplication-square310x310logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x310.png"> 
95
+		<meta name="msapplication-square70x70logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-70x70.png"> 
96
+		<meta name="msapplication-square144x144logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> 
97
+		<meta name="msapplication-square150x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-150x150.png"> 
98
+		<meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x150.png"> 
99
+		<meta name="msapplication-square310x310logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x310.png"> 
100 100
 	</head>
101 101
 	
102 102
 	<body>
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 			{
200 200
 				$.ajax({
201 201
 				  type: "POST",
202
-				  url: "<?php echo $baseUrl;?>vote-ajax.php?pw=<?php echo $_GET["pw"]?>",
202
+				  url: "<?php echo $baseUrl; ?>vote-ajax.php?pw=<?php echo $_GET["pw"]?>",
203 203
 				  data: {"vote" : data["vote"],
204 204
 						 "postId" : data["id"]},
205 205
 				  success: function(result){
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 				console.log(solution);
247 247
 				$.ajax({
248 248
 				  type: "POST",
249
-				  url: "<?php echo $baseUrl;?>vote-ajax.php?pw=<?php echo $_GET["pw"]?>&solution=" + solution + "&key="+key,
249
+				  url: "<?php echo $baseUrl; ?>vote-ajax.php?pw=<?php echo $_GET["pw"]?>&solution=" + solution + "&key="+key,
250 250
 				  data: {"deviceUid" : deviceUid},
251 251
 				  success: function(result){
252 252
 					  var response = JSON.parse(result);
Please login to merge, or discard this patch.
index.php 3 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 	}
50 50
 	if(!isset($posts[0]))
51 51
 	{
52
-		error_log('Fehler: ' . print_r($posts, true) . print_r($posts['recent'], true) . print_r($posts['posts'], true));
52
+		error_log('Fehler: ' . print_r($posts, TRUE) . print_r($posts['recent'], TRUE) . print_r($posts['posts'], TRUE));
53 53
 		$title = $view->getTitle();
54 54
 		$description = $view->getMetaDescription();
55 55
 	}
Please login to merge, or discard this 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.
Braces   +21 added lines, -6 removed lines patch added patch discarded remove patch
@@ -96,7 +96,9 @@  discard block
 block discarded – undo
96 96
 							} ?>
97 97
 					</content>
98 98
 					
99
-					<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?>
99
+					<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails']))
100
+{
101
+?>
100 102
 						<p id="loading">
101 103
 							Loading…
102 104
 						</p>
@@ -104,12 +106,20 @@  discard block
 block discarded – undo
104 106
 				</article>
105 107
 			
106 108
 				<aside class="topSidebar col-sm-4 sidebar-outer">
107
-					<div class="fixed<?php if(!$view->isDetailedView) echo(' hide-mobile');?>">
109
+					<div class="fixed<?php if(!$view->isDetailedView)
110
+{
111
+	echo(' hide-mobile');
112
+}
113
+?>">
108 114
 						<article>
109 115
 							<div>
110 116
 								<h2>Position / Hashtag</h2>
111 117
 								<form action="index.php" method="get">
112
-									<input type="text" id="city" name="search" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required>
118
+									<input type="text" id="city" name="search" placeholder="<?php if(isset($newPositionStatus))
119
+{
120
+	echo $newPositionStatus;
121
+}
122
+?>" required>
113 123
 									<label>try: #jhj</label><br>
114 124
 									<input type="submit" value="Set Location" /> 
115 125
 								</form>
@@ -126,7 +136,7 @@  discard block
 block discarded – undo
126 136
 						<article>
127 137
 							<div>
128 138
 								<?php if(!$jodelAccountForView->isAccountVerified())
129
-								{
139
+{
130 140
 								?>
131 141
 								<h2>New Jodel</h2>
132 142
 								
@@ -138,7 +148,9 @@  discard block
 block discarded – undo
138 148
 								{
139 149
 
140 150
 
141
-									if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) { ?>
151
+									if(isset($_GET['postId']) && isset($_GET['getPostDetails']))
152
+									{
153
+?>
142 154
 									<h2>Comment on Jodel</h2>
143 155
 									<form method="POST">				
144 156
 											<input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']);?>" />
@@ -146,7 +158,10 @@  discard block
 block discarded – undo
146 158
 										<br />
147 159
 										<input type="submit" value="SEND" /> 
148 160
 									</form>
149
-										<?php } else { ?>
161
+										<?php }
162
+else
163
+{
164
+?>
150 165
 									<h2>New Jodel</h2>
151 166
 									<form enctype="multipart/form-data" method="POST">
152 167
 										<textarea id="message" name="message" placeholder="Send a Jodel to all students within 10km" required></textarea> 
Please login to merge, or discard this patch.
php/CustomError.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -13,17 +13,17 @@
 block discarded – undo
13 13
 	public $varsToDump;
14 14
 
15 15
 	function __construct($msg = 'not Set', $varsToDump = 'not Set', $view = 'not Set', $actions = 'not Set', $accountId = 'not Set', $isVerified = 'not Set', $isTokenFresh = 'not Set', $page = 'not Set', $referrer = 'not Set')
16
-    {
17
-        $this->view = $view;
18
-        $this->actions = $actions;
19
-        $this->accountId = $accountId;
20
-        $this->isVerified = $isVerified;
21
-        $this->isTokenFresh = $isTokenFresh;
22
-        $this->page = $page;
23
-        $this->referrer = $referrer;
24
-        $this->msg = $msg;
25
-        $this->varsToDump = $varsToDump;
26
-    }
16
+	{
17
+		$this->view = $view;
18
+		$this->actions = $actions;
19
+		$this->accountId = $accountId;
20
+		$this->isVerified = $isVerified;
21
+		$this->isTokenFresh = $isTokenFresh;
22
+		$this->page = $page;
23
+		$this->referrer = $referrer;
24
+		$this->msg = $msg;
25
+		$this->varsToDump = $varsToDump;
26
+	}
27 27
 
28 28
 	function writeErrorToLog()
29 29
 	{
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 	public $varsToDump;
14 14
 
15 15
 	function __construct($msg = 'not Set', $varsToDump = 'not Set', $view = 'not Set', $actions = 'not Set', $accountId = 'not Set', $isVerified = 'not Set', $isTokenFresh = 'not Set', $page = 'not Set', $referrer = 'not Set')
16
-    {
16
+	{
17 17
         $this->view = $view;
18 18
         $this->actions = $actions;
19 19
         $this->accountId = $accountId;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 	{
30 30
 		error_log("=============================== ERROR ================================");
31 31
 		error_log("msg: " . $this->msg);
32
-		error_log("view: " . print_r($this->view, true));
32
+		error_log("view: " . print_r($this->view, TRUE));
33 33
 		error_log("actions: " . $this->actionsToString());
34 34
 		error_log("accountId: " . $this->accountId);
35 35
 		error_log("isVerified: " . $this->isVerified);
Please login to merge, or discard this patch.
php/View.php 4 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -49,25 +49,25 @@  discard block
 block discarded – undo
49 49
         $timediff_inDays = (string)$timediff->format('%d');
50 50
         $timediff_inMonth = (string)$timediff->format('%m');
51 51
 
52
-        if($timediff_inMonth!=0)
52
+        if($timediff_inMonth != 0)
53 53
         {
54 54
                 $timediff = $timediff_inMonth . "m";
55 55
         }
56 56
         else
57 57
         {
58
-            if($timediff_inDays!=0)
58
+            if($timediff_inDays != 0)
59 59
             {
60 60
                 $timediff = $timediff_inDays . "d";
61 61
             }
62 62
             else
63 63
             {
64
-                if($timediff_inHours!=0)
64
+                if($timediff_inHours != 0)
65 65
                 {
66 66
                     $timediff = $timediff_inHours . "h";
67 67
                 }
68 68
                 else
69 69
                 {
70
-                    if($timediff_inMinutes!=0)
70
+                    if($timediff_inMinutes != 0)
71 71
                     {
72 72
                         $timediff = $timediff_inMinutes . "m";
73 73
                     }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
 
83 83
         ?>
84
-        <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color'];?>;">
84
+        <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color']; ?>;">
85 85
             <content>
86 86
                 <?php 
87 87
                 if(isset($post['image_url']))
@@ -96,12 +96,12 @@  discard block
 block discarded – undo
96 96
                 ?>
97 97
             </content>
98 98
             <aside>                    
99
-                <button onclick="vote('<?php echo $post['post_id'];?>', 'up', this)">
99
+                <button onclick="vote('<?php echo $post['post_id']; ?>', 'up', this)">
100 100
                     <i class="fa fa-angle-up fa-3x"></i>
101 101
                 </button>    
102
-                <br><span><?php echo $post["vote_count"];?></span><br>
102
+                <br><span><?php echo $post["vote_count"]; ?></span><br>
103 103
 
104
-                <button onclick="vote('<?php echo $post['post_id'];?>', 'down', this)">
104
+                <button onclick="vote('<?php echo $post['post_id']; ?>', 'down', this)">
105 105
                     <i class="fa fa-angle-down fa-3x"></i>
106 106
                 </button>
107 107
             </aside>
@@ -112,14 +112,14 @@  discard block
 block discarded – undo
112 112
                         <span class="time">
113 113
                             <span class="tip" data-tooltip="Time">
114 114
                                 <i class="fa fa-clock-o"></i>
115
-                                <?php echo $timediff;?>
116
-                                <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span>
115
+                                <?php echo $timediff; ?>
116
+                                <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s'); ?></span>
117 117
                             </span> 
118 118
                         </span>
119 119
 						<?php if(!$this->isDetailedView) {?>
120 120
                         <span class="comments">
121 121
                             <span data-tooltip="Comments">
122
-                                <a href="<?php echo $this->changePostId($post['post_id'])->toUrl();?>">
122
+                                <a href="<?php echo $this->changePostId($post['post_id'])->toUrl(); ?>">
123 123
                                     <i class="fa fa-commenting-o"></i>
124 124
                                     <?php if(array_key_exists("child_count", $post))
125 125
                                     {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                         </span>
133 133
 						<?php
134 134
 						}															  
135
-						if (isUserAdmin())
135
+						if(isUserAdmin())
136 136
 						{
137 137
 						?>
138 138
 						<span class="voting">
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                                         {
163 163
                                             ?>
164 164
                                             <span data-tooltip="Author">
165
-                                                <i class="fa fa-user-o"></i> #<?php echo $post['user_handle'];?> |
165
+                                                <i class="fa fa-user-o"></i> #<?php echo $post['user_handle']; ?> |
166 166
                                             </span>
167 167
                                             <?php
168 168
                                         }
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
 
173 173
                             <span class="tip" data-tooltip="Distance">
174 174
                                 <i class="fa fa-map-marker"></i>
175
-                                <?php echo $post['distance'];?> km
176
-                                <span class="tiptext"><?php echo $post['location']['name'];?></span>
175
+                                <?php echo $post['distance']; ?> km
176
+                                <span class="tiptext"><?php echo $post['location']['name']; ?></span>
177 177
                             </span>
178 178
                         </span>
179 179
                     
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
 		if($post != '' && array_key_exists('message', $post) && $post['message'] != '' && $this->isDetailedView)
214 214
 		{
215
-			$description = 'On JodelBlue in ' . htmlspecialchars($this->city) .  ' with ' . htmlspecialchars($post['vote_count']) . ' Upvotes: ' . substr(htmlspecialchars($post['message']), 0, 130);
215
+			$description = 'On JodelBlue in ' . htmlspecialchars($this->city) . ' with ' . htmlspecialchars($post['vote_count']) . ' Upvotes: ' . substr(htmlspecialchars($post['message']), 0, 130);
216 216
 		}
217 217
 
218 218
 		return $description;
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
         {
310 310
             return $data['recent'];
311 311
         }
312
-        else if(array_key_exists('posts', $data)&& array_key_exists(0, $data['posts']))
312
+        else if(array_key_exists('posts', $data) && array_key_exists(0, $data['posts']))
313 313
         {
314 314
             return $data['posts'];
315 315
         }
Please login to merge, or discard this patch.
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,7 +34,8 @@  discard block
 block discarded – undo
34 34
 	 * Compute HTML Code
35 35
 	 */
36 36
  	function jodelToHtml($post)
37
-    {   //ToDO
37
+ 	{
38
+//ToDO
38 39
         //Replace # with link
39 40
         //preg_replace('~(\#)([^\s!,. /()"\'?]+)~', '<a href="tag/$2">#$2</a>', $text);
40 41
 
@@ -90,7 +91,8 @@  discard block
 block discarded – undo
90 91
 
91 92
                     echo '<img src="' . $post['image_url'] . '" alt="' . htmlspecialchars(preg_replace($regexRest, '', $post['message'])) . '">';
92 93
                 }
93
-                else {
94
+                else
95
+                {
94 96
                     echo str_replace('  ', ' &nbsp;', nl2br(htmlspecialchars($post['message'])));
95 97
                 }
96 98
                 ?>
@@ -116,15 +118,20 @@  discard block
 block discarded – undo
116 118
                                 <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span>
117 119
                             </span> 
118 120
                         </span>
119
-						<?php if(!$this->isDetailedView) {?>
121
+						<?php if(!$this->isDetailedView)
122
+{
123
+?>
120 124
                         <span class="comments">
121 125
                             <span data-tooltip="Comments">
122 126
                                 <a href="<?php echo $this->changePostId($post['post_id'])->toUrl();?>">
123 127
                                     <i class="fa fa-commenting-o"></i>
124 128
                                     <?php if(array_key_exists("child_count", $post))
125
-                                    {
129
+{
126 130
                                         echo $post["child_count"];
127
-                                    } else echo "0";
131
+                                    }
132
+                                    else {
133
+                                    	echo "0";
134
+                                    }
128 135
                                     ?>
129 136
                                 </a>
130 137
                             </span>
@@ -306,7 +313,7 @@  discard block
 block discarded – undo
306 313
             $data = $accountCreator->execute();
307 314
         }
308 315
     	if(array_key_exists('recent', $data) && array_key_exists(0, $data['recent']))
309
-        {
316
+    	{
310 317
             return $data['recent'];
311 318
         }
312 319
         else if(array_key_exists('posts', $data)&& array_key_exists(0, $data['posts']))
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -317,7 +317,7 @@
 block discarded – undo
317 317
         {
318 318
             if($this->lastPostId == '')
319 319
             {
320
-                error_log('Could not find Posts in: ' . $this->city . ' Error: ' . print_r($data, true));
320
+                error_log('Could not find Posts in: ' . $this->city . ' Error: ' . print_r($data, TRUE));
321 321
                 //error_log(print_r($data, true));
322 322
 
323 323
                 $notFound[0] = array(
Please login to merge, or discard this patch.
Indentation   +226 added lines, -226 removed lines patch added patch discarded remove patch
@@ -2,98 +2,98 @@  discard block
 block discarded – undo
2 2
 
3 3
 class View
4 4
 {
5
-    public $country;
6
-    public $city;
7
-    public $hashtag;
5
+	public $country;
6
+	public $city;
7
+	public $hashtag;
8 8
 	public $view;
9
-    public $postId;
10
-    public $isDetailedView;
11
-    public $baseUrl;
9
+	public $postId;
10
+	public $isDetailedView;
11
+	public $baseUrl;
12 12
 
13 13
 	public $lastPostId = '';
14 14
 
15
-    function __construct($baseUrl, $country, $city, $hashtag = '%23all', $view = 'time', $postId = '')
16
-    {
17
-        $this->baseUrl = $baseUrl;
18
-        $this->country = $country;
19
-        $this->city = $city;
20
-        $this->hashtag = urldecode($hashtag);
21
-        $this->view = $view;
22
-        $this->postId = $postId;
15
+	function __construct($baseUrl, $country, $city, $hashtag = '%23all', $view = 'time', $postId = '')
16
+	{
17
+		$this->baseUrl = $baseUrl;
18
+		$this->country = $country;
19
+		$this->city = $city;
20
+		$this->hashtag = urldecode($hashtag);
21
+		$this->view = $view;
22
+		$this->postId = $postId;
23 23
 
24
-        if($postId == '')
25
-        {
26
-            $this->isDetailedView = FALSE;
27
-        }
28
-        else
29
-        {
30
-            $this->isDetailedView = TRUE;
31
-        }
32
-    }
24
+		if($postId == '')
25
+		{
26
+			$this->isDetailedView = FALSE;
27
+		}
28
+		else
29
+		{
30
+			$this->isDetailedView = TRUE;
31
+		}
32
+	}
33 33
 	/**
34 34
 	 * Compute HTML Code
35 35
 	 */
36 36
  	function jodelToHtml($post)
37
-    {   //ToDO
38
-        //Replace # with link
39
-        //preg_replace('~(\#)([^\s!,. /()"\'?]+)~', '<a href="tag/$2">#$2</a>', $text);
37
+	{   //ToDO
38
+		//Replace # with link
39
+		//preg_replace('~(\#)([^\s!,. /()"\'?]+)~', '<a href="tag/$2">#$2</a>', $text);
40 40
 
41
-        //Time to time difference
42
-        $now = new DateTime();
43
-        $d = new DateTime($post['created_at']);
44
-        $timediff = $now->diff($d);
41
+		//Time to time difference
42
+		$now = new DateTime();
43
+		$d = new DateTime($post['created_at']);
44
+		$timediff = $now->diff($d);
45 45
 
46
-        $timediff_inSeconds = (string)$timediff->format('%s');
47
-        $timediff_inMinutes = (string)$timediff->format('%i');
48
-        $timediff_inHours = (string)$timediff->format('%h');
49
-        $timediff_inDays = (string)$timediff->format('%d');
50
-        $timediff_inMonth = (string)$timediff->format('%m');
46
+		$timediff_inSeconds = (string)$timediff->format('%s');
47
+		$timediff_inMinutes = (string)$timediff->format('%i');
48
+		$timediff_inHours = (string)$timediff->format('%h');
49
+		$timediff_inDays = (string)$timediff->format('%d');
50
+		$timediff_inMonth = (string)$timediff->format('%m');
51 51
 
52
-        if($timediff_inMonth!=0)
53
-        {
54
-                $timediff = $timediff_inMonth . "m";
55
-        }
56
-        else
57
-        {
58
-            if($timediff_inDays!=0)
59
-            {
60
-                $timediff = $timediff_inDays . "d";
61
-            }
62
-            else
63
-            {
64
-                if($timediff_inHours!=0)
65
-                {
66
-                    $timediff = $timediff_inHours . "h";
67
-                }
68
-                else
69
-                {
70
-                    if($timediff_inMinutes!=0)
71
-                    {
72
-                        $timediff = $timediff_inMinutes . "m";
73
-                    }
74
-                    else
75
-                    {
76
-                        $timediff = $timediff_inSeconds . "s";
77
-                    }
78
-                }
79
-            }
80
-        }
52
+		if($timediff_inMonth!=0)
53
+		{
54
+				$timediff = $timediff_inMonth . "m";
55
+		}
56
+		else
57
+		{
58
+			if($timediff_inDays!=0)
59
+			{
60
+				$timediff = $timediff_inDays . "d";
61
+			}
62
+			else
63
+			{
64
+				if($timediff_inHours!=0)
65
+				{
66
+					$timediff = $timediff_inHours . "h";
67
+				}
68
+				else
69
+				{
70
+					if($timediff_inMinutes!=0)
71
+					{
72
+						$timediff = $timediff_inMinutes . "m";
73
+					}
74
+					else
75
+					{
76
+						$timediff = $timediff_inSeconds . "s";
77
+					}
78
+				}
79
+			}
80
+		}
81 81
 
82 82
 
83
-        ?>
83
+		?>
84 84
         <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color'];?>;">
85 85
             <content>
86 86
                 <?php 
87
-                if(isset($post['image_url']))
88
-                {
89
-                    $regexRest = '/[^\w$ .!?-]+/u';
87
+				if(isset($post['image_url']))
88
+				{
89
+					$regexRest = '/[^\w$ .!?-]+/u';
90 90
 
91
-                    echo '<img src="' . $post['image_url'] . '" alt="' . htmlspecialchars(preg_replace($regexRest, '', $post['message'])) . '">';
92
-                }
93
-                else {
94
-                    echo str_replace('  ', ' &nbsp;', nl2br(htmlspecialchars($post['message'])));
95
-                }
96
-                ?>
91
+					echo '<img src="' . $post['image_url'] . '" alt="' . htmlspecialchars(preg_replace($regexRest, '', $post['message'])) . '">';
92
+				}
93
+				else {
94
+					echo str_replace('  ', ' &nbsp;', nl2br(htmlspecialchars($post['message'])));
95
+				}
96
+				?>
97 97
             </content>
98 98
             <aside>                    
99 99
                 <button onclick="vote('<?php echo $post['post_id'];?>', 'up', this)">
@@ -122,10 +122,10 @@  discard block
 block discarded – undo
122 122
                                 <a href="<?php echo $this->changePostId($post['post_id'])->toUrl();?>">
123 123
                                     <i class="fa fa-commenting-o"></i>
124 124
                                     <?php if(array_key_exists("child_count", $post))
125
-                                    {
126
-                                        echo $post["child_count"];
127
-                                    } else echo "0";
128
-                                    ?>
125
+									{
126
+										echo $post["child_count"];
127
+									} else echo "0";
128
+									?>
129 129
                                 </a>
130 130
                             </span>
131 131
                             
@@ -145,30 +145,30 @@  discard block
 block discarded – undo
145 145
 						?>
146 146
                         <span class="distance">
147 147
                             <?php
148
-                                if($this->isDetailedView)
149
-                                {
150
-                                    if(isset($post['user_handle']) && $post['user_handle'] == 'OJ')
151
-                                    {
152
-                                        ?>
148
+								if($this->isDetailedView)
149
+								{
150
+									if(isset($post['user_handle']) && $post['user_handle'] == 'OJ')
151
+									{
152
+										?>
153 153
                                         <span data-tooltip="Author">
154 154
                                             <i class="fa fa-user-o"></i> OJ |
155 155
                                         </span>
156 156
                                         <?php 
157
-                                    }
158
-                                    else
159
-                                    {
160
-                                        //Is not parent Jodel in detailed View
161
-                                        if(!array_key_exists('child_count', $post))
162
-                                        {
163
-                                            ?>
157
+									}
158
+									else
159
+									{
160
+										//Is not parent Jodel in detailed View
161
+										if(!array_key_exists('child_count', $post))
162
+										{
163
+											?>
164 164
                                             <span data-tooltip="Author">
165 165
                                                 <i class="fa fa-user-o"></i> #<?php echo $post['user_handle'];?> |
166 166
                                             </span>
167 167
                                             <?php
168
-                                        }
169
-                                    }
170
-                                }
171
-                                ?>
168
+										}
169
+									}
170
+								}
171
+								?>
172 172
 
173 173
                             <span class="tip" data-tooltip="Distance">
174 174
                                 <i class="fa fa-map-marker"></i>
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
             </footer>
182 182
         </article>
183 183
     <?php
184
-    }
184
+	}
185 185
 
186 186
 
187 187
 	/**
@@ -218,147 +218,147 @@  discard block
 block discarded – undo
218 218
 		return $description;
219 219
 	}
220 220
 
221
-    function toUrl($msg = '')
222
-    {
223
-        $url = $this->baseUrl . 'index.php?country=DE' .
224
-                            '&city=' . urlencode($this->city) .
225
-                            '&hashtag=' . urlencode($this->hashtag) . 
226
-                            '&view=' . $this->view;
227
-        if($this->postId != '')
228
-        {
229
-            $url .= '&postId=' . $this->postId . 
230
-                    '&getPostDetails=TRUE';
231
-        }
221
+	function toUrl($msg = '')
222
+	{
223
+		$url = $this->baseUrl . 'index.php?country=DE' .
224
+							'&city=' . urlencode($this->city) .
225
+							'&hashtag=' . urlencode($this->hashtag) . 
226
+							'&view=' . $this->view;
227
+		if($this->postId != '')
228
+		{
229
+			$url .= '&postId=' . $this->postId . 
230
+					'&getPostDetails=TRUE';
231
+		}
232 232
 
233
-        if($msg != '')
234
-        {
235
-            $url .= '&msg=' . urlencode($msg);
236
-        }
233
+		if($msg != '')
234
+		{
235
+			$url .= '&msg=' . urlencode($msg);
236
+		}
237 237
 
238
-        return $url;
239
-    }
238
+		return $url;
239
+	}
240 240
 
241
-    function changePostId($postId)
242
-    {
243
-        $tempView = clone $this;
244
-        $tempView->postId = $postId;
245
-        $tempView->isDetailedView = TRUE;
246
-        return $tempView;
247
-    }
241
+	function changePostId($postId)
242
+	{
243
+		$tempView = clone $this;
244
+		$tempView->postId = $postId;
245
+		$tempView->isDetailedView = TRUE;
246
+		return $tempView;
247
+	}
248 248
 
249
-    function back()
250
-    {
251
-        $tempView = clone $this;
252
-        $tempView->postId = '';
253
-        return $tempView;
254
-    }
249
+	function back()
250
+	{
251
+		$tempView = clone $this;
252
+		$tempView->postId = '';
253
+		return $tempView;
254
+	}
255 255
 
256
-    function changeView($view)
257
-    {
258
-        $tempView = clone $this;
259
-        $tempView->view = $view;
260
-        return $tempView;
261
-    }
256
+	function changeView($view)
257
+	{
258
+		$tempView = clone $this;
259
+		$tempView->view = $view;
260
+		return $tempView;
261
+	}
262 262
 
263 263
 	function getPosts($jodelAccount)
264 264
 	{
265
-        if($this->hashtag != '#all' && $this->hashtag != '' && $this->hashtag != NULL)
266
-        {
267
-            $accountCreator = new GetChannel();
268
-            $accountCreator->view = $this->view;
269
-            $accountCreator->setAccessToken($jodelAccount->accessToken);
270
-            $accountCreator->channel = $this->hashtag;
271
-            $accountCreator->lastPostId = $this->lastPostId;
272
-            $data = $accountCreator->execute();
273
-        }
274
-        else
275
-        {
276
-            if($this->lastPostId == '' && $this->view == 'combo')
277
-            {
278
-                $url = "/v3/posts/location/combo";
279
-            }
280
-            else
281
-            {
282
-                if($this->view == 'discussed')
283
-                {
284
-                    $url = "/v2/posts/location/discussed/";
285
-                }
286
-                else
287
-                {
288
-                    if($this->view == 'popular')
289
-                    {
290
-                        $url = "/v2/posts/location/popular/";
291
-                    }
292
-                    else
293
-                    {
294
-                        $url = "/v2/posts/location/";
295
-                    }
296
-                }
297
-            }
265
+		if($this->hashtag != '#all' && $this->hashtag != '' && $this->hashtag != NULL)
266
+		{
267
+			$accountCreator = new GetChannel();
268
+			$accountCreator->view = $this->view;
269
+			$accountCreator->setAccessToken($jodelAccount->accessToken);
270
+			$accountCreator->channel = $this->hashtag;
271
+			$accountCreator->lastPostId = $this->lastPostId;
272
+			$data = $accountCreator->execute();
273
+		}
274
+		else
275
+		{
276
+			if($this->lastPostId == '' && $this->view == 'combo')
277
+			{
278
+				$url = "/v3/posts/location/combo";
279
+			}
280
+			else
281
+			{
282
+				if($this->view == 'discussed')
283
+				{
284
+					$url = "/v2/posts/location/discussed/";
285
+				}
286
+				else
287
+				{
288
+					if($this->view == 'popular')
289
+					{
290
+						$url = "/v2/posts/location/popular/";
291
+					}
292
+					else
293
+					{
294
+						$url = "/v2/posts/location/";
295
+					}
296
+				}
297
+			}
298 298
 
299
-            $accountCreator = new GetPosts();
300
-            $accountCreator->setLastPostId($this->lastPostId);
301
-            $accountCreator->setAccessToken($jodelAccount->accessToken);
302
-            $accountCreator->setUrl($url);
303
-            $accountCreator->version = 'v3';
299
+			$accountCreator = new GetPosts();
300
+			$accountCreator->setLastPostId($this->lastPostId);
301
+			$accountCreator->setAccessToken($jodelAccount->accessToken);
302
+			$accountCreator->setUrl($url);
303
+			$accountCreator->version = 'v3';
304 304
 
305
-            $config = parse_ini_file('config/config.ini.php');
306
-            $location = new Location();
307
-            $location->setLat($config['default_lat']);
308
-            $location->setLng($config['default_lng']);
309
-            $location->setCityName($config['default_location']);
310
-            $accountCreator->location = $location;
311
-            $data = $accountCreator->execute();
312
-        }
313
-    	if(array_key_exists('recent', $data) && array_key_exists(0, $data['recent']))
314
-        {
315
-            return $data['recent'];
316
-        }
317
-        else if(array_key_exists('posts', $data)&& array_key_exists(0, $data['posts']))
318
-        {
319
-            return $data['posts'];
320
-        }
321
-        else
322
-        {
323
-            if($this->lastPostId == '')
324
-            {
325
-                error_log('Could not find Posts in: ' . $this->city . ' Error: ' . print_r($data, true));
326
-                //error_log(print_r($data, true));
305
+			$config = parse_ini_file('config/config.ini.php');
306
+			$location = new Location();
307
+			$location->setLat($config['default_lat']);
308
+			$location->setLng($config['default_lng']);
309
+			$location->setCityName($config['default_location']);
310
+			$accountCreator->location = $location;
311
+			$data = $accountCreator->execute();
312
+		}
313
+		if(array_key_exists('recent', $data) && array_key_exists(0, $data['recent']))
314
+		{
315
+			return $data['recent'];
316
+		}
317
+		else if(array_key_exists('posts', $data)&& array_key_exists(0, $data['posts']))
318
+		{
319
+			return $data['posts'];
320
+		}
321
+		else
322
+		{
323
+			if($this->lastPostId == '')
324
+			{
325
+				error_log('Could not find Posts in: ' . $this->city . ' Error: ' . print_r($data, true));
326
+				//error_log(print_r($data, true));
327 327
 
328
-                $notFound[0] = array(
329
-                    "post_id" => "0",
330
-                    "discovered_by" => 0,
331
-                    "message" => "No more Posts found",
332
-                    "created_at" => "2017-02-11T16:44:50.385Z",
333
-                    "updated_at" => "2017-02-11T16:44:50.385Z",
334
-                    "pin_count" => 0,
335
-                    "color" => "5682a3",
336
-                    "got_thanks" => FALSE,
337
-                    "post_own" => "friend",
338
-                    "discovered" => 0,
339
-                    "distance" => 9,
340
-                    "vote_count" => 0,
341
-                    "location" =>
342
-                    array("name" => "Berlin",
343
-                      "loc_coordinates" =>
344
-                      array(
345
-                        "lat" => 0,
346
-                        "lng" => 0
347
-                      ),
348
-                      "loc_accuracy" => 0,
349
-                      "country" => "",
350
-                      "city" => "",
351
-                    ),
352
-                    "tags" =>
353
-                    array(),
354
-                    "user_handle" => "0"
355
-                );
356
-                return $notFound;
357
-            }
358
-            else
359
-            {
360
-                return FALSE;
361
-            }
362
-        }
328
+				$notFound[0] = array(
329
+					"post_id" => "0",
330
+					"discovered_by" => 0,
331
+					"message" => "No more Posts found",
332
+					"created_at" => "2017-02-11T16:44:50.385Z",
333
+					"updated_at" => "2017-02-11T16:44:50.385Z",
334
+					"pin_count" => 0,
335
+					"color" => "5682a3",
336
+					"got_thanks" => FALSE,
337
+					"post_own" => "friend",
338
+					"discovered" => 0,
339
+					"distance" => 9,
340
+					"vote_count" => 0,
341
+					"location" =>
342
+					array("name" => "Berlin",
343
+					  "loc_coordinates" =>
344
+					  array(
345
+						"lat" => 0,
346
+						"lng" => 0
347
+					  ),
348
+					  "loc_accuracy" => 0,
349
+					  "country" => "",
350
+					  "city" => "",
351
+					),
352
+					"tags" =>
353
+					array(),
354
+					"user_handle" => "0"
355
+				);
356
+				return $notFound;
357
+			}
358
+			else
359
+			{
360
+				return FALSE;
361
+			}
362
+		}
363 363
 	}
364 364
 }
Please login to merge, or discard this patch.
templates/captcha.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 ?>
6 6
 <div id="captchaWrapper">
7 7
 	<p>Check all images with Coons on it (Coons look like <img style="height: 1.0em; width: unset;" src="img/coon.png">).</p>
8
-	<img src="<?php echo $captcha['image_url'];?>">
8
+	<img src="<?php echo $captcha['image_url']; ?>">
9 9
 	<div class='captchaWrapper'>
10 10
 		<input id='box_0' type='checkbox'>
11 11
 		<input id='box_1' type='checkbox'>
@@ -17,5 +17,5 @@  discard block
 block discarded – undo
17 17
 		<input id='box_7' type='checkbox'>
18 18
 		<input id='box_8' type='checkbox'>
19 19
 	</div>
20
-	<button onClick="verifyAccount('<?php echo $captcha['key'];?>','<?php echo $jodelAccountForView->deviceUid?>')">Verify</button>
20
+	<button onClick="verifyAccount('<?php echo $captcha['key']; ?>','<?php echo $jodelAccountForView->deviceUid?>')">Verify</button>
21 21
 </div>
22 22
\ No newline at end of file
Please login to merge, or discard this patch.
php/Requests/AbstractRequest.php 4 patches
Indentation   +158 added lines, -158 removed lines patch added patch discarded remove patch
@@ -2,21 +2,21 @@  discard block
 block discarded – undo
2 2
 
3 3
 abstract class AbstractRequest
4 4
 {	
5
-    const CLIENTID = '81e8a76e-1e02-4d17-9ba0-8a7020261b26';
6
-    const APIURL = 'https://api.go-tellm.com/api';
7
-    const SECRET = 'SDydTnTdqqaiAMfneLkqXYxamvNuUYOmkqpdiZTu';
8
-    const USERAGENT = 'Jodel/4.34.2 Dalvik/2.1.0 (Linux; U; Android 5.1.1; )';
9
-    const CLIENT_TYPE = 'android_4.34.2';
5
+	const CLIENTID = '81e8a76e-1e02-4d17-9ba0-8a7020261b26';
6
+	const APIURL = 'https://api.go-tellm.com/api';
7
+	const SECRET = 'SDydTnTdqqaiAMfneLkqXYxamvNuUYOmkqpdiZTu';
8
+	const USERAGENT = 'Jodel/4.34.2 Dalvik/2.1.0 (Linux; U; Android 5.1.1; )';
9
+	const CLIENT_TYPE = 'android_4.34.2';
10 10
     
11
-    private $accessToken = null;
12
-    private $payLoad;
13
-    public $expects = '';
14
-    public $version = 'v2';
15
-    public $hasPayload = FALSE;
11
+	private $accessToken = null;
12
+	private $payLoad;
13
+	public $expects = '';
14
+	public $version = 'v2';
15
+	public $hasPayload = FALSE;
16 16
 
17
-    public function execute()
18
-    {
19
-        $result = new \stdClass();
17
+	public function execute()
18
+	{
19
+		$result = new \stdClass();
20 20
 		        
21 21
 		$this->payLoad = $this->getPayload();
22 22
 		$device_uid = '';
@@ -25,16 +25,16 @@  discard block
 block discarded – undo
25 25
 		}
26 26
 				
27 27
 				
28
-        $this->payLoad = json_encode($this->payLoad);
29
-        $header = $this->getSignHeaders();
30
-        $url = $this->getFullUrl();
28
+		$this->payLoad = json_encode($this->payLoad);
29
+		$header = $this->getSignHeaders();
30
+		$url = $this->getFullUrl();
31 31
 
32
-        if ($this->getAccessToken()) {
33
-            $header['Authorization'] = "Bearer " . $this->getAccessToken();
34
-        }
35
-        //Comment out to debug the Request:
32
+		if ($this->getAccessToken()) {
33
+			$header['Authorization'] = "Bearer " . $this->getAccessToken();
34
+		}
35
+		//Comment out to debug the Request:
36 36
 
37
-        /*
37
+		/*
38 38
         printf("URL: ");
39 39
         var_dump($url);
40 40
         echo "<br />";
@@ -45,111 +45,111 @@  discard block
 block discarded – undo
45 45
         var_dump($this->payLoad);
46 46
         echo "<br />";
47 47
         */
48
-        /*
48
+		/*
49 49
         $options = array(
50 50
             'timeout' => 100,
51 51
             'connect_timeout' => 100,
52 52
             'proxy' => '186.103.169.165:8080',
53 53
         );*/
54 54
 
55
-        switch ($this->getMethod()) {
56
-            case 'POST':
57
-                $result = Requests::post($url, $header, $this->payLoad);
58
-                break;
59
-            case 'GET':
60
-                if($this->hasPayload)
61
-                {
62
-                    $result = Requests::get($url, $header, $this->payLoad);
63
-                }
64
-                else
65
-                {
66
-                    $result = Requests::get($url, $header);
67
-                }
68
-                break;
69
-            case 'PUT':
70
-                $result = Requests::put($url, $header, $this->payLoad);
71
-                break;
72
-        }
55
+		switch ($this->getMethod()) {
56
+			case 'POST':
57
+				$result = Requests::post($url, $header, $this->payLoad);
58
+				break;
59
+			case 'GET':
60
+				if($this->hasPayload)
61
+				{
62
+					$result = Requests::get($url, $header, $this->payLoad);
63
+				}
64
+				else
65
+				{
66
+					$result = Requests::get($url, $header);
67
+				}
68
+				break;
69
+			case 'PUT':
70
+				$result = Requests::put($url, $header, $this->payLoad);
71
+				break;
72
+		}
73 73
 
74
-        http_response_code($result->status_code);
74
+		http_response_code($result->status_code);
75 75
 
76
-        switch ($result->status_code) {
77
-            case 200:
78
-                $result = json_decode($result->body, true);
79
-                break;
80
-            case 204:
81
-                $result = 'Success';
82
-                http_response_code(200);
83
-                break;
84
-            case 400:
85
-                $result = json_decode($result->body, true);
86
-                error_log('Error 400 - ' . print_r($result, true));
87
-                break;
88
-            case 401:
89
-                $result = json_decode($result->body, true);
76
+		switch ($result->status_code) {
77
+			case 200:
78
+				$result = json_decode($result->body, true);
79
+				break;
80
+			case 204:
81
+				$result = 'Success';
82
+				http_response_code(200);
83
+				break;
84
+			case 400:
85
+				$result = json_decode($result->body, true);
86
+				error_log('Error 400 - ' . print_r($result, true));
87
+				break;
88
+			case 401:
89
+				$result = json_decode($result->body, true);
90 90
 
91
-                if(array_key_exists('error', $result) && $result['error'] == 'length')
92
-                {
91
+				if(array_key_exists('error', $result) && $result['error'] == 'length')
92
+				{
93 93
 
94
-                }
95
-                else
96
-                {
97
-                    error_log('Error 401 - ' . print_r($result, true));
98
-                }
99
-                break;
100
-            case 404:
101
-                error_log('Error 404 - ' . print_r($result, true));
102
-                $result = json_decode($result->body, true);
103
-                break;
94
+				}
95
+				else
96
+				{
97
+					error_log('Error 401 - ' . print_r($result, true));
98
+				}
99
+				break;
100
+			case 404:
101
+				error_log('Error 404 - ' . print_r($result, true));
102
+				$result = json_decode($result->body, true);
103
+				break;
104 104
 			case 477:
105
-                $result = json_decode($result->body, true);
106
-                error_log('Error 477 - ' . print_r($result, true));
107
-                break;
108
-            case 429:
109
-                error_log('Error 429 - Too Many Requests' . print_r(json_decode($result->body, true), true));
110
-            	exit("Error 429: Too Many Requests");
111
-            	break;
112
-            case 403:
113
-                error_log('Error 403 - Access denied:' . print_r(json_decode($result->body, true), true));
114
-                $result = json_decode($result->body, true);
115
-                break;
116
-            case 502:
117
-                error_log('Error 502 - ' . print_r($result, true));
118
-                $result = json_decode($result->body, true);
119
-                break;
120
-            case 503:
121
-                error_log('Error 503 - ' . print_r($result, true));
122
-                $result = json_decode($result->body, true);
105
+				$result = json_decode($result->body, true);
106
+				error_log('Error 477 - ' . print_r($result, true));
107
+				break;
108
+			case 429:
109
+				error_log('Error 429 - Too Many Requests' . print_r(json_decode($result->body, true), true));
110
+				exit("Error 429: Too Many Requests");
111
+				break;
112
+			case 403:
113
+				error_log('Error 403 - Access denied:' . print_r(json_decode($result->body, true), true));
114
+				$result = json_decode($result->body, true);
115
+				break;
116
+			case 502:
117
+				error_log('Error 502 - ' . print_r($result, true));
118
+				$result = json_decode($result->body, true);
119
+				break;
120
+			case 503:
121
+				error_log('Error 503 - ' . print_r($result, true));
122
+				$result = json_decode($result->body, true);
123 123
 
124
-                if(array_key_exists('error', $result) && $result['error'] == 'Service Unavailable')
125
-                {
126
-                    header('location:'.$_SERVER['PHP_SELF']); 
127
-                }
128
-                break;
129
-            default:
130
-                error_log('Error '.$result->status_code.' - unknown error');
131
-                $result = json_decode($result->body, true);
132
-        }
124
+				if(array_key_exists('error', $result) && $result['error'] == 'Service Unavailable')
125
+				{
126
+					header('location:'.$_SERVER['PHP_SELF']); 
127
+				}
128
+				break;
129
+			default:
130
+				error_log('Error '.$result->status_code.' - unknown error');
131
+				$result = json_decode($result->body, true);
132
+		}
133 133
 
134
-        //important for account refresh
135
-        if($device_uid != '')
136
-        {
134
+		//important for account refresh
135
+		if($device_uid != '')
136
+		{
137 137
 			$result[0] = $result;
138 138
 			$result[1] = $device_uid;
139
-        }
139
+		}
140 140
 
141 141
         
142
-        /* var_dump($result); */
142
+		/* var_dump($result); */
143 143
         
144
-        return $result;
145
-    }
146
-    abstract function getPayload();
147
-    /**
148
-     * Gets Sign headers
149
-     * @return array headers
150
-     */
151
-    private function getSignHeaders()
152
-    {
144
+		return $result;
145
+	}
146
+	abstract function getPayload();
147
+	/**
148
+	 * Gets Sign headers
149
+	 * @return array headers
150
+	 */
151
+	private function getSignHeaders()
152
+	{
153 153
 			if($this->getAccessToken() == null) {
154 154
 				$payload_accessToken = "";
155 155
 			}
@@ -158,54 +158,54 @@  discard block
 block discarded – undo
158 158
 			}
159 159
 			
160 160
 			
161
-        $headers = array(
162
-            "Connection" => "keep-alive",
163
-            "Accept-Encoding" => "gzip",
164
-            "Content-Type" => "application/json; charset=UTF-8",
165
-            "User-Agent" => self::USERAGENT
166
-        );
167
-        $timestamp = new DateTime();
168
-        $timestamp = $timestamp->format(DateTime::ATOM);
169
-        $timestamp = substr($timestamp, 0, -6);
170
-        $timestamp .= "Z";
171
-        $urlParts = parse_url($this->getFullUrl());
172
-        $url2 = "";
173
-        $req = [$this->getMethod(),
174
-            $urlParts['host'],
175
-            "443",
176
-            $urlParts['path'],
177
-            $payload_accessToken,
178
-            $timestamp,
179
-            $url2,
180
-            $this->payLoad];
181
-        $reqString = implode("%", $req);
182
-        $secret = self::SECRET;
183
-        $signature = hash_hmac('sha1', $reqString, $secret);
184
-        $signature = strtoupper($signature);
185
-        $headers['X-Authorization'] = 'HMAC ' . $signature;
186
-        $headers['X-Client-Type'] = self::CLIENT_TYPE;
187
-        $headers['X-Timestamp'] = $timestamp;
188
-        $headers['X-Api-Version'] = '0.2';
189
-        return $headers;
190
-    }
191
-    private function getFullUrl()
192
-    {
193
-        return self::APIURL . $this->getApiEndPoint();
194
-    }
195
-    abstract function getApiEndPoint();
196
-    abstract function getMethod();
197
-    /**
198
-     * @return string
199
-     */
200
-    private function getAccessToken()
201
-    {
202
-        return $this->accessToken;
203
-    }
204
-    /**
205
-     * @param string $accessToken
206
-     */
207
-    public function setAccessToken($accessToken)
208
-    {
209
-        $this->accessToken = $accessToken;
210
-    }
161
+		$headers = array(
162
+			"Connection" => "keep-alive",
163
+			"Accept-Encoding" => "gzip",
164
+			"Content-Type" => "application/json; charset=UTF-8",
165
+			"User-Agent" => self::USERAGENT
166
+		);
167
+		$timestamp = new DateTime();
168
+		$timestamp = $timestamp->format(DateTime::ATOM);
169
+		$timestamp = substr($timestamp, 0, -6);
170
+		$timestamp .= "Z";
171
+		$urlParts = parse_url($this->getFullUrl());
172
+		$url2 = "";
173
+		$req = [$this->getMethod(),
174
+			$urlParts['host'],
175
+			"443",
176
+			$urlParts['path'],
177
+			$payload_accessToken,
178
+			$timestamp,
179
+			$url2,
180
+			$this->payLoad];
181
+		$reqString = implode("%", $req);
182
+		$secret = self::SECRET;
183
+		$signature = hash_hmac('sha1', $reqString, $secret);
184
+		$signature = strtoupper($signature);
185
+		$headers['X-Authorization'] = 'HMAC ' . $signature;
186
+		$headers['X-Client-Type'] = self::CLIENT_TYPE;
187
+		$headers['X-Timestamp'] = $timestamp;
188
+		$headers['X-Api-Version'] = '0.2';
189
+		return $headers;
190
+	}
191
+	private function getFullUrl()
192
+	{
193
+		return self::APIURL . $this->getApiEndPoint();
194
+	}
195
+	abstract function getApiEndPoint();
196
+	abstract function getMethod();
197
+	/**
198
+	 * @return string
199
+	 */
200
+	private function getAccessToken()
201
+	{
202
+		return $this->accessToken;
203
+	}
204
+	/**
205
+	 * @param string $accessToken
206
+	 */
207
+	public function setAccessToken($accessToken)
208
+	{
209
+		$this->accessToken = $accessToken;
210
+	}
211 211
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 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;
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
 
124 124
                 if(array_key_exists('error', $result) && $result['error'] == 'Service Unavailable')
125 125
                 {
126
-                    header('location:'.$_SERVER['PHP_SELF']); 
126
+                    header('location:' . $_SERVER['PHP_SELF']); 
127 127
                 }
128 128
                 break;
129 129
             default:
130
-                error_log('Error '.$result->status_code.' - unknown error');
130
+                error_log('Error ' . $result->status_code . ' - unknown error');
131 131
                 $result = json_decode($result->body, true);
132 132
         }
133 133
 
Please login to merge, or discard this patch.
Braces   +13 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 abstract class AbstractRequest
4
-{	
4
+{
5 5
     const CLIENTID = '81e8a76e-1e02-4d17-9ba0-8a7020261b26';
6 6
     const APIURL = 'https://api.go-tellm.com/api';
7 7
     const SECRET = 'SDydTnTdqqaiAMfneLkqXYxamvNuUYOmkqpdiZTu';
@@ -20,7 +20,8 @@  discard block
 block discarded – undo
20 20
 		        
21 21
 		$this->payLoad = $this->getPayload();
22 22
 		$device_uid = '';
23
-		if(isset($this->payLoad['device_uid'])) {
23
+		if(isset($this->payLoad['device_uid']))
24
+		{
24 25
 			$device_uid = $this->payLoad['device_uid'];
25 26
 		}
26 27
 				
@@ -29,7 +30,8 @@  discard block
 block discarded – undo
29 30
         $header = $this->getSignHeaders();
30 31
         $url = $this->getFullUrl();
31 32
 
32
-        if ($this->getAccessToken()) {
33
+        if ($this->getAccessToken())
34
+        {
33 35
             $header['Authorization'] = "Bearer " . $this->getAccessToken();
34 36
         }
35 37
         //Comment out to debug the Request:
@@ -52,7 +54,8 @@  discard block
 block discarded – undo
52 54
             'proxy' => '186.103.169.165:8080',
53 55
         );*/
54 56
 
55
-        switch ($this->getMethod()) {
57
+        switch ($this->getMethod())
58
+        {
56 59
             case 'POST':
57 60
                 $result = Requests::post($url, $header, $this->payLoad);
58 61
                 break;
@@ -73,7 +76,8 @@  discard block
 block discarded – undo
73 76
 
74 77
         http_response_code($result->status_code);
75 78
 
76
-        switch ($result->status_code) {
79
+        switch ($result->status_code)
80
+        {
77 81
             case 200:
78 82
                 $result = json_decode($result->body, true);
79 83
                 break;
@@ -150,10 +154,12 @@  discard block
 block discarded – undo
150 154
      */
151 155
     private function getSignHeaders()
152 156
     {
153
-			if($this->getAccessToken() == null) {
157
+			if($this->getAccessToken() == null)
158
+			{
154 159
 				$payload_accessToken = "";
155 160
 			}
156
-			else {
161
+			else
162
+			{
157 163
 				$payload_accessToken = $this->getAccessToken();
158 164
 			}
159 165
 			
Please login to merge, or discard this patch.
Upper-Lower-Casing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
     const USERAGENT = 'Jodel/4.34.2 Dalvik/2.1.0 (Linux; U; Android 5.1.1; )';
9 9
     const CLIENT_TYPE = 'android_4.34.2';
10 10
     
11
-    private $accessToken = null;
11
+    private $accessToken = NULL;
12 12
     private $payLoad;
13 13
     public $expects = '';
14 14
     public $version = 'v2';
@@ -75,18 +75,18 @@  discard block
 block discarded – undo
75 75
 
76 76
         switch ($result->status_code) {
77 77
             case 200:
78
-                $result = json_decode($result->body, true);
78
+                $result = json_decode($result->body, TRUE);
79 79
                 break;
80 80
             case 204:
81 81
                 $result = 'Success';
82 82
                 http_response_code(200);
83 83
                 break;
84 84
             case 400:
85
-                $result = json_decode($result->body, true);
86
-                error_log('Error 400 - ' . print_r($result, true));
85
+                $result = json_decode($result->body, TRUE);
86
+                error_log('Error 400 - ' . print_r($result, TRUE));
87 87
                 break;
88 88
             case 401:
89
-                $result = json_decode($result->body, true);
89
+                $result = json_decode($result->body, TRUE);
90 90
 
91 91
                 if(array_key_exists('error', $result) && $result['error'] == 'length')
92 92
                 {
@@ -94,32 +94,32 @@  discard block
 block discarded – undo
94 94
                 }
95 95
                 else
96 96
                 {
97
-                    error_log('Error 401 - ' . print_r($result, true));
97
+                    error_log('Error 401 - ' . print_r($result, TRUE));
98 98
                 }
99 99
                 break;
100 100
             case 404:
101
-                error_log('Error 404 - ' . print_r($result, true));
102
-                $result = json_decode($result->body, true);
101
+                error_log('Error 404 - ' . print_r($result, TRUE));
102
+                $result = json_decode($result->body, TRUE);
103 103
                 break;
104 104
 			case 477:
105
-                $result = json_decode($result->body, true);
106
-                error_log('Error 477 - ' . print_r($result, true));
105
+                $result = json_decode($result->body, TRUE);
106
+                error_log('Error 477 - ' . print_r($result, TRUE));
107 107
                 break;
108 108
             case 429:
109
-                error_log('Error 429 - Too Many Requests' . print_r(json_decode($result->body, true), true));
109
+                error_log('Error 429 - Too Many Requests' . print_r(json_decode($result->body, TRUE), TRUE));
110 110
             	exit("Error 429: Too Many Requests");
111 111
             	break;
112 112
             case 403:
113
-                error_log('Error 403 - Access denied:' . print_r(json_decode($result->body, true), true));
114
-                $result = json_decode($result->body, true);
113
+                error_log('Error 403 - Access denied:' . print_r(json_decode($result->body, TRUE), TRUE));
114
+                $result = json_decode($result->body, TRUE);
115 115
                 break;
116 116
             case 502:
117
-                error_log('Error 502 - ' . print_r($result, true));
118
-                $result = json_decode($result->body, true);
117
+                error_log('Error 502 - ' . print_r($result, TRUE));
118
+                $result = json_decode($result->body, TRUE);
119 119
                 break;
120 120
             case 503:
121
-                error_log('Error 503 - ' . print_r($result, true));
122
-                $result = json_decode($result->body, true);
121
+                error_log('Error 503 - ' . print_r($result, TRUE));
122
+                $result = json_decode($result->body, TRUE);
123 123
 
124 124
                 if(array_key_exists('error', $result) && $result['error'] == 'Service Unavailable')
125 125
                 {
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
                 break;
129 129
             default:
130 130
                 error_log('Error '.$result->status_code.' - unknown error');
131
-                $result = json_decode($result->body, true);
131
+                $result = json_decode($result->body, TRUE);
132 132
         }
133 133
 
134 134
         //important for account refresh
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      */
151 151
     private function getSignHeaders()
152 152
     {
153
-			if($this->getAccessToken() == null) {
153
+			if($this->getAccessToken() == NULL) {
154 154
 				$payload_accessToken = "";
155 155
 			}
156 156
 			else {
Please login to merge, or discard this patch.