Skip to content

Commit 07e2761

Browse files
author
Mariusz Soltys
committed
added url_decode in search query normalization
1 parent d6222df commit 07e2761

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/QAS.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,17 @@ public function getMethods()
172172
return $functions;
173173
}
174174

175+
/**
176+
* Can be used to validate method names before doing eval()
177+
*
178+
* @return array Array containing allowed method names
179+
*/
180+
public function getAllowedMethods()
181+
{
182+
$methods = ['call', 'search', 'refine', 'getAddress', 'getMethods'];
183+
return $methods;
184+
}
185+
175186
/**
176187
* @return string JSON encoded response from server
177188
* @throws QASException

src/Utils.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public function formatSearchQuery($query)
3333
$query = array_filter($query);
3434

3535
return join(", ", $query);
36+
} else {
37+
$query = urldecode($query);
3638
}
3739

3840
return $query;

0 commit comments

Comments
 (0)