Skip to content

Commit

Permalink
fix: corrected paths for REST API v3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Nov 2, 2024
1 parent a902e7d commit 5b5879f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions phpmyfaq/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -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/<ACTION>
RewriteRule ^api/v3.0/(.*) api/index.php [L,QSA]
# REST API v3.0 and v3.1
# * http://[...]/api/v3.x/<ACTION>
RewriteRule ^api/v3\.[01]/(.*) api/index.php [L,QSA]

</IfModule>
8 changes: 4 additions & 4 deletions phpmyfaq/src/phpMyFAQ/Controller/Api/FaqController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]')
)]
Expand Down
4 changes: 2 additions & 2 deletions phpmyfaq/src/phpMyFAQ/Faq.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5b5879f

Please sign in to comment.