diff options
| author | 2014-05-13 21:03:32 +0200 | |
|---|---|---|
| committer | 2014-05-13 21:03:32 +0200 | |
| commit | a86a51cca69b7256d3a8dcf1c68447b6d5abe917 (patch) | |
| tree | b461e144d54656fb3c2c95aee96d6303cf6fa12c /lib/lib_rss.php | |
| parent | 88fa624a02d0346c2eb9173b1e9a02fc38b56d50 (diff) | |
| parent | e763cd407a57e4829c2b6ffbddb164e5676670d7 (diff) | |
Merge branch 'dev' into 320-template
Diffstat (limited to 'lib/lib_rss.php')
| -rw-r--r-- | lib/lib_rss.php | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php index a13d9e951..0f8161129 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -27,7 +27,7 @@ function classAutoloader($class) { include(APP_PATH . '/Models/' . $components[1] . '.php'); return; case 3: //Controllers, Exceptions - include(APP_PATH . '/' . $components[2] . 's/' . $components[1] . $components[2] . '.php'); + @include(APP_PATH . '/' . $components[2] . 's/' . $components[1] . $components[2] . '.php'); return; } } elseif (strpos($class, 'Minz') === 0) { @@ -219,7 +219,7 @@ function invalidateHttpCache() { } function usernameFromPath($userPath) { - if (preg_match('%/([a-z0-9]{1,16})_user\.php$%', $userPath, $matches)) { + if (preg_match('%/([A-Za-z0-9]{1,16})_user\.php$%', $userPath, $matches)) { return $matches[1]; } else { return ''; @@ -233,3 +233,18 @@ function listUsers() { function httpAuthUser() { return isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'] : ''; } + +function cryptAvailable() { + if (version_compare(PHP_VERSION, '5.3.3', '>=')) { + try { + $hash = '$2y$04$usesomesillystringfore7hnbRJHxXVLeakoG8K30oukPsA.ztMG'; + return $hash === @crypt('password', $hash); + } catch (Exception $e) { + } + } + return false; +} + +function html_chars_utf8($str) { + return htmlspecialchars($str, ENT_COMPAT, 'UTF-8'); +} |
