Fix matching of periods in path

This commit is contained in:
Yarmo Mackenbach 2020-06-28 23:57:55 +02:00
parent 21a5934216
commit 5a575bc0ad

View file

@ -18,19 +18,17 @@ $router->map('GET', '/proofs/[:uid]', function() {}, 'proofsUid');
$router->map('GET', '/verify/hkp/[:uid]', function() {}, 'verifyHKP'); $router->map('GET', '/verify/hkp/[:uid]', function() {}, 'verifyHKP');
$router->map('GET', '/encrypt/hkp/[:uid]', function() {}, 'encryptHKP'); $router->map('GET', '/encrypt/hkp/[:uid]', function() {}, 'encryptHKP');
$router->map('GET', '/proofs/hkp/[:uid]', function() {}, 'proofsHKP'); $router->map('GET', '/proofs/hkp/[:uid]', function() {}, 'proofsHKP');
$router->map('GET', '/verify/wkd/[:uid]', function() {}, 'verifyWKD'); $router->map('GET', '/verify/wkd/[**:uid]', function() {}, 'verifyWKD');
$router->map('GET', '/encrypt/wkd/[:uid]', function() {}, 'encryptWKD'); $router->map('GET', '/encrypt/wkd/[**:uid]', function() {}, 'encryptWKD');
$router->map('GET', '/proofs/wkd/[:uid]', function() {}, 'proofsWKD'); $router->map('GET', '/proofs/wkd/[**:uid]', function() {}, 'proofsWKD');
$router->map('GET', '/guides', function() {}, 'guides'); $router->map('GET', '/guides', function() {}, 'guides');
$router->map('GET', '/guides/[:id]', function() {}, 'guideId'); $router->map('GET', '/guides/[:id]', function() {}, 'guideId');
$router->map('GET', '/faq', function() {}, 'faq'); $router->map('GET', '/faq', function() {}, 'faq');
$router->map('GET', '/[:uid]', function() {}, 'profile'); $router->map('GET', '/[**:uid]', function() {}, 'profile');
// Router matching // Router matching
$match = $router->match(); $match = $router->match();
print_r($match);
// Render the appropriate route // Render the appropriate route
if(is_array($match) && is_callable($match['target'])) { if(is_array($match) && is_callable($match['target'])) {
switch ($match['name']) { switch ($match['name']) {