@@ -198,13 +198,17 @@ class BookController extends BaseController
private function getBidCidFromUrl(string $url)
{
- if (preg_match('/bid=(\w+)\S+cid=(\w+)/', $url, $matches)) {
+ if (preg_match('/\?bid=(\w+)\S+cid=(\w+)/', $url, $matches) || preg_match('/\?id=(\w+)/', $url, $matches)) {
return [
'bid' => $matches[1],
- 'cid' => $matches[2],
+ 'cid' => isset($matches[2]) ? $matches[2] : 0,
+ ];
+ } else {
+ return [
+ 'bid' => '',
+ 'cid' => 0,
];
}
- return false;