Skip to content

Commit aa5666b

Browse files
committed
🚨 Escape output in multilang demo. Fix bramus#96
1 parent 5707299 commit aa5666b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

demo-multilang/index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ public function __construct(array $allowedLanguages, $defaultLanguage)
6565
);
6666

6767
$router->get('/([a-z0-9_-]+)', function ($language) {
68-
exit('This is the ' . $language . ' index');
68+
exit('This is the ' . htmlentities($language) . ' index');
6969
});
7070

7171
$router->get('/([a-z0-9_-]+)/([a-z0-9_-]+)', function ($language, $slug) {
72-
exit('This is the ' . $language . ' version of ' . $slug);
72+
exit('This is the ' . htmlentities($language) . ' version of ' . htmlentities($slug));
7373
});
7474

7575
$router->get('/([a-z0-9_-]+)/(.*)', function ($language, $slug) {
76-
exit('This is the ' . $language . ' version of ' . $slug . ' (multiple segments allowed)');
76+
exit('This is the ' . htmlentities($language) . ' version of ' . htmlentities($slug) . ' (multiple segments allowed)');
7777
});
7878

7979
// Thunderbirds are go!

0 commit comments

Comments
 (0)