Skip to content

Commit 15332dd

Browse files
author
Tom Clarke
committed
Moving from Slim to Silex
1 parent aba8fa1 commit 15332dd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

web/index.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
$currentURL = (isset($_SERVER['HTTPS']) ? "https" : "http") . '://' . $_SERVER['HTTP_HOST'] . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
1717

1818
$app['twig']->addGlobal('currenturl', $currentURL);
19+
$app['debug'] = true;
1920

2021
$app['images'] = function () use ($app) {
2122
return new Images($app);
@@ -46,13 +47,13 @@
4647
}
4748
$app['images']->serve($width, $height, '', $request);
4849
})
49-
->assert('width', '\d+');
50-
->assert('height', '\d+');
50+
->assert('width', '[\d]*')
51+
->assert('height', '[\d]*');
5152

5253
$app->get('/{width}', function($width) use($app) {
5354
$app->redirect("/$width/$width", 303);
5455
})
55-
->assert('width', '\d+');
56+
->assert('width', '[\d]*');
5657

5758
$app->get('/{width}/{height}/{person}', function($width, $height, $person, Request $request) use($app) {
5859
if($width > 3000 || $height > 3000) {
@@ -61,8 +62,8 @@
6162
}
6263
$app['images']->serve($width, $height, $person, $request);
6364
})
64-
->assert('width', '\d+')
65-
->assert('height', '\d+');
65+
->assert('width', '[\d]*')
66+
->assert('height', '[\d]*');
6667

6768
// Attribution
6869
$app->get('/attribution', function() use($app) {

0 commit comments

Comments
 (0)