@@ -18,7 +18,8 @@ public function match(): void
18
18
if (!empty (Config::basepath ())) {
19
19
$ router ->setBasePath ('/ ' . Config::basepath ());
20
20
}
21
- $ router ->addMatchTypes (array ('cid ' => '[^/]+ ' ));
21
+ $ router ->addMatchTypes (array ('noslash ' => '[^/]+ ' ));
22
+ $ router ->addMatchTypes (array ('cid ' => Model::ID_REGEX ));
22
23
$ router ->addRoutes ([
23
24
['GET ' , '/api/v0/page/[cid:page] ' , 'Controllerapipage#get ' , 'apipageget ' ],
24
25
['GET ' , '/api/v0/pages/list ' , 'Controllerapipage#list ' , 'apipagelist ' ],
@@ -69,13 +70,13 @@ public function match(): void
69
70
['POST ' , '/!profile ' , 'Controllerprofile#update ' , 'profileupdate ' ],
70
71
['POST ' , '/!profile/password ' , 'Controllerprofile#password ' , 'profilepassword ' ],
71
72
['GET ' , '/!info ' , 'Controllerinfo#desktop ' , 'info ' ],
72
- ['GET ' , '/[cid :page]/ ' , 'Controllerpage#pagepermanentredirect ' , 'pageread/ ' ],
73
+ ['GET ' , '/[noslash :page]/ ' , 'Controllerpage#pagepermanentredirect ' , 'pageread/ ' ],
73
74
['HEAD ' , '/[cid:page]/ ' , 'Controllerpage#pagepermanentredirect ' , 'pageread/head ' ],
74
75
['POST ' , '/[cid:page] ' , 'Controllerpage#read ' , 'pagereadpost ' ], /** Used for password protected pages */
75
- ['GET ' , '/[cid :page] ' , 'Controllerpage#read ' , 'pageread ' ],
76
+ ['GET ' , '/[noslash :page] ' , 'Controllerpage#read ' , 'pageread ' ],
76
77
['HEAD ' , '/[cid:page] ' , 'Controllerpage#readhead ' , 'pagereadhead ' ],
77
- ['GET ' , '/[cid :page]/add ' , 'Controllerpage#add ' , 'pageadd ' ],
78
- ['GET ' , '/[cid :page]/add:[cid:copy] ' , 'Controllerpage#addascopy ' , 'pageaddascopy ' ],
78
+ ['GET ' , '/[noslash :page]/add ' , 'Controllerpage#add ' , 'pageadd ' ],
79
+ ['GET ' , '/[noslash :page]/add:[cid:copy] ' , 'Controllerpage#addascopy ' , 'pageaddascopy ' ],
79
80
['GET ' , '/[cid:page]/edit ' , 'Controllerpage#edit ' , 'pageedit ' ],
80
81
['GET ' , '/[cid:page]/render ' , 'Controllerpage#render ' , 'pagerender ' ],
81
82
['GET ' , '/[cid:page]/log ' , 'Controllerpage#log ' , 'pagelog ' ],
@@ -86,7 +87,7 @@ public function match(): void
86
87
['POST ' , '/workspace/update ' , 'Controllerworkspace#update ' , 'workspaceupdate ' ],
87
88
['GET ' , '/[cid:page]/delete ' , 'Controllerpage#delete ' , 'pagedelete ' ],
88
89
['POST ' , '/[cid:page]/delete ' , 'Controllerpage#confirmdelete ' , 'pageconfirmdelete ' ],
89
- ['GET ' , '/[cid:page]/duplicate:[cid :duplicate] ' , 'Controllerpage#duplicate ' , 'pageduplicate ' ],
90
+ ['GET ' , '/[cid:page]/duplicate:[noslash :duplicate] ' , 'Controllerpage#duplicate ' , 'pageduplicate ' ],
90
91
['GET ' , '/[cid:page]/[*:command] ' , 'Controllerpage#commandnotfound ' , 'pageread/etoile ' ],
91
92
]);
92
93
0 commit comments