diff --git a/nginx.conf b/nginx.conf index ad70c9045c..f1a1f82cac 100644 --- a/nginx.conf +++ b/nginx.conf @@ -125,8 +125,8 @@ server { # Administration API rewrite admin/api/(.*) /admin/api/index.php last; - # REST API v3.0 - rewrite api/v3.0/(.*) /api/index.php last; + # REST API v3.0 and v3.1 + rewrite ^api/v3\.[01]/(.*) /api/index.php last; break; } diff --git a/phpmyfaq/.htaccess b/phpmyfaq/.htaccess index 6f07e79d40..f6988406ec 100644 --- a/phpmyfaq/.htaccess +++ b/phpmyfaq/.htaccess @@ -181,8 +181,8 @@ Header set Access-Control-Allow-Headers "Content-Type, Authorization" # Setup APIs RewriteRule ^api/setup/(check|backup|update-database) api/index.php [L,QSA] - # REST API v3.0 - # * http://[...]/api/v3.0/ - RewriteRule ^api/v3.0/(.*) api/index.php [L,QSA] + # REST API v3.0 and v3.1 + # * http://[...]/api/v3.x/ + RewriteRule ^api/v3\.[01]/(.*) api/index.php [L,QSA] diff --git a/phpmyfaq/src/phpMyFAQ/Controller/Api/FaqController.php b/phpmyfaq/src/phpMyFAQ/Controller/Api/FaqController.php index 96d031fc7d..010bdeba47 100644 --- a/phpmyfaq/src/phpMyFAQ/Controller/Api/FaqController.php +++ b/phpmyfaq/src/phpMyFAQ/Controller/Api/FaqController.php @@ -417,14 +417,14 @@ public function getTrending(): JsonResponse { "question": "How can I survive without phpMyFAQ?", "url": "https://www.example.org/index.php?action=faq&cat=1&id=36&artlang=de", - "id": "8", - "order": "1" + "id": 8, + "order": 1 }, { "question": "Is there life after death?", "url": "https://www.example.org/index.php?action=faq&cat=1&id=1&artlang=en", - "id": "10", - "order": "2" + "id": 10, + "order": 2 } ]') )] diff --git a/phpmyfaq/src/phpMyFAQ/Faq.php b/phpmyfaq/src/phpMyFAQ/Faq.php index 0589252dc2..9278d08b9f 100755 --- a/phpmyfaq/src/phpMyFAQ/Faq.php +++ b/phpmyfaq/src/phpMyFAQ/Faq.php @@ -1608,8 +1608,8 @@ public function getStickyFaqsData(): array $oLink->itemTitle = $row->thema; $oLink->tooltip = $title; $data['url'] = $oLink->toString(); - $data['id'] = $row->id; - $data['order'] = $row->sticky_order; + $data['id'] = (int) $row->id; + $data['order'] = (int) $row->sticky_order; $sticky[] = $data; }