Skip to content

Commit 41fd049

Browse files
authored
Merge pull request joni2back#260 from AshDevFr/master
Fix "Function not implemented" issue using php-local
2 parents 728060c + 4da5b14 commit 41fd049

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

bridges/php-local/LocalBridge/Rest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function handle()
103103
if (isset($_GET)) {
104104
$queries = $_GET;
105105
}
106-
106+
107107
if (isset($this->callbacks['before'])) {
108108
$this->callbacks['before']($queries, $body['data'], $body['files']);
109109
}
@@ -150,17 +150,17 @@ private function parseBody()
150150
$data = null;
151151
$files = null;
152152

153-
if (isset($_POST) || !empty($_POST)) {
153+
if (isset($_POST) && !empty($_POST)) {
154154
$data = $_POST;
155155
}
156156

157-
if (isset($_FILES) || !empty($_FILES)) {
157+
if (isset($_FILES) && !empty($_FILES)) {
158158
$files = $_FILES;
159159
}
160160

161161
//In case of PUT request or request with json body
162162
if ($data === null) {
163-
if (isset($_SERVER["CONTENT_TYPE"]) || strpos($_SERVER["CONTENT_TYPE"], 'application/json') !== false) {
163+
if (isset($_SERVER["CONTENT_TYPE"]) && strpos($_SERVER["CONTENT_TYPE"], 'application/json') !== false) {
164164
$input = file_get_contents('php://input');
165165

166166
$data = json_decode($input, true);
@@ -190,7 +190,7 @@ private function verifyAuthentication()
190190

191191
if (isset($headers['Authorization'])) {
192192
$token = str_replace('Token ', '', $headers['Authorization']);
193-
193+
194194
$authenticated = token::verify($token);
195195
}
196196

0 commit comments

Comments
 (0)