Skip to content

Commit

Permalink
Case insensitive support to tagger options
Browse files Browse the repository at this point in the history
  • Loading branch information
jjrom committed May 6, 2022
1 parent 4f618ac commit a396945
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/include/iTag/iTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class iTag
* )
* )
*/
const VERSION = '5.3.3';
const VERSION = '5.3.5';

/*
* Character separator
Expand Down Expand Up @@ -137,7 +137,7 @@ public function tag($metadata, $taggers = array())
*/
foreach ($taggers as $name => $options) {

$tagger = $this->instantiateTagger(ucfirst($name) . 'Tagger');
$tagger = $this->instantiateTagger(ucfirst(strtolower(trim($name))) . 'Tagger');

if (isset($tagger)) {

Expand Down
16 changes: 8 additions & 8 deletions app/include/iTagLauncher.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,12 @@ private function getParams()

foreach (array_values($taggersList) as $value) {

$taggerName = ucfirst(trim($value));
$taggerName = ucfirst(strtolower(trim($value)));
$taggerOptions = array();

foreach (array_keys($query) as $key ) {
$exploded = explode('_', $key);
if ( count($exploded) === 2 && $exploded[0] === $taggerName ) {
if ( count($exploded) === 2 && ucfirst(strtolower(trim($exploded[0]))) === $taggerName ) {
$taggerOptions[$exploded[1]] = $this->formatInput($query[$key]);
}
}
Expand All @@ -377,13 +377,13 @@ private function getParams()

$params = array(
'metadata' => array(
'geometry' => rawurldecode(filter_input(INPUT_GET, 'geometry', FILTER_SANITIZE_STRING)),
'timestamp' => rawurldecode(filter_input(INPUT_GET, 'timestamp', FILTER_SANITIZE_STRING))
'geometry' => rawurldecode(filter_input(INPUT_GET, 'geometry', FILTER_UNSAFE_RAW)),
'timestamp' => rawurldecode(filter_input(INPUT_GET, 'timestamp', FILTER_UNSAFE_RAW))
),
'taggers' => $taggers,
'config' => array(
'returnGeometries' => isset($query['_wkt']) ? filter_var($query['_wkt'], FILTER_VALIDATE_BOOLEAN) : false,
'planet' => rawurldecode(filter_input(INPUT_GET, 'planet', FILTER_SANITIZE_STRING))
'planet' => rawurldecode(filter_input(INPUT_GET, 'planet', FILTER_UNSAFE_RAW))
)
);

Expand Down Expand Up @@ -420,9 +420,9 @@ private function answer($response, $responseStatus)
*/
private function setCORSHeaders()
{
$httpOrigin = filter_input(INPUT_SERVER, 'HTTP_ORIGIN', FILTER_SANITIZE_STRING);
$httpRequestMethod = filter_input(INPUT_SERVER, 'HTTP_ACCESS_CONTROL_REQUEST_METHOD', FILTER_SANITIZE_STRING);
$httpRequestHeaders = filter_input(INPUT_SERVER, 'HTTP_ACCESS_CONTROL_REQUEST_HEADERS', FILTER_SANITIZE_STRING);
$httpOrigin = filter_input(INPUT_SERVER, 'HTTP_ORIGIN', FILTER_UNSAFE_RAW);
$httpRequestMethod = filter_input(INPUT_SERVER, 'HTTP_ACCESS_CONTROL_REQUEST_METHOD', FILTER_UNSAFE_RAW);
$httpRequestHeaders = filter_input(INPUT_SERVER, 'HTTP_ACCESS_CONTROL_REQUEST_HEADERS', FILTER_UNSAFE_RAW);

/*
* Only set access to known servers
Expand Down

0 comments on commit a396945

Please sign in to comment.