diff options
| author | 2014-06-13 18:51:52 +0200 | |
|---|---|---|
| committer | 2014-06-13 18:51:52 +0200 | |
| commit | f58fdfe93dbf969338fe9cecbd728e0f7add4617 (patch) | |
| tree | e1629da3361235d1c4ef28944624326491628045 /lib/lib_rss.php | |
| parent | c053825ff8f9792e692c101585481129b006937b (diff) | |
| parent | 61f4d5457818204eb28ed394d4f1b97160542baa (diff) | |
Merge branch 'dev' into beta
Diffstat (limited to 'lib/lib_rss.php')
| -rw-r--r-- | lib/lib_rss.php | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 1bb117ab6..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) { @@ -214,12 +214,12 @@ function uSecString() { } function invalidateHttpCache() { - touch(LOG_PATH . '/' . Minz_Session::param('currentUser', '_') . '.log'); Minz_Session::_param('touch', uTimeString()); + return touch(LOG_PATH . '/' . Minz_Session::param('currentUser', '_') . '.log'); } 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'); +} |
