namibia
df0489e1eeeeab5a9bd44e1d84fce49924fe1bac
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
<?php /** * Detect whether request should be debugged * * @package Minify * @author Stephen Clay <steve@mrclay.org> */ class Minify_DebugDetector { public static function shouldDebugRequest($cookie, $get, $requestUri) { if (isset($get['debug'])) { return true; } if (! empty($cookie['minifyDebug'])) { foreach (preg_split('/\\s+/', $cookie['minifyDebug']) as $debugUri) { $pattern = '@' . preg_quote($debugUri, '@') . '@i'; $pattern = str_replace(array('\\*', '\\?'), array('.*', '.'), $pattern); if (preg_match($pattern, $requestUri)) { return true; } } } return false; } } |
Commits for namibiapublic/min/lib/Minify/DebugDetector.php
Revision | Author | Commited | Message |
---|---|---|---|
df0489 ... | Mark | Fri 14 Oct, 2016 10:01:00 +0000 | initial commit |