diff --git a/classes/Config.php b/classes/Config.php index 866dc00..4ec7e0b 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -171,19 +171,10 @@ class Config extends Object // Defaults profiler to true if it doesn't match an option exactly if (isset($this->data['pickles']['profiler'])) { - if ($this->data['pickles']['profiler'] !== true) + // If we have an array convert to a string + if (is_array($this->data['pickles']['profiler'])) { - // If we have an array convert to a string - if (is_array($this->data['pickles']['profiler'])) - { - $this->data['pickles']['profiler'] = implode(',', $this->data['pickles']['profiler']); - } - - // Checks that one of our known values exists, if not, force true - if (preg_match('/(objects|timers|queries|explains)/', $this->data['pickles']['profiler'] == false)) - { - $this->data['pickles']['profiler'] = true; - } + $this->data['pickles']['profiler'] = implode(',', $this->data['pickles']['profiler']); } } else diff --git a/classes/Controller.php b/classes/Controller.php index 9e83beb..cdc5e86 100644 --- a/classes/Controller.php +++ b/classes/Controller.php @@ -487,7 +487,14 @@ class Controller extends Object // Scrubs class names with hyphens if (strpos($module_class, '-') !== false) { - $module_class = preg_replace('/(-(.{1}))/e', 'strtoupper("$2")', $module_class); + $module_class = preg_replace_callback( + '/(-(.{1}))/', + function ($matches) + { + return strtoupper($matches[2]); + }, + $module_class + ); } return array($module_class, $module_filename, $template_basename, $css_class, $js_basename); diff --git a/classes/Database/PDO/Common.php b/classes/Database/PDO/Common.php index 0c2305d..51e9d88 100644 --- a/classes/Database/PDO/Common.php +++ b/classes/Database/PDO/Common.php @@ -227,7 +227,7 @@ class Database_PDO_Common extends Database_Common $end_time = microtime(true); $duration = $end_time - $start_time; - if ($duration >= 1) + if ($duration >= 1 && isset($loggable_query)) { Log::slowQuery($duration . ' seconds: ' . $loggable_query); } diff --git a/classes/Security.php b/classes/Security.php index 85bd07a..84c83bc 100644 --- a/classes/Security.php +++ b/classes/Security.php @@ -255,12 +255,14 @@ class Security if (self::checkSession() == true && isset($_SESSION['__pickles']['security']['user_id'])) { // Checks the session against the cookie + /* if (isset($_SESSION['__pickles']['security']['token'], $_COOKIE['pickles_security_token']) && $_SESSION['__pickles']['security']['token'] != $_COOKIE['pickles_security_token']) { Security::logout(); } - elseif (isset($_SESSION['__pickles']['security']['level']) && $_SESSION['__pickles']['security']['level'] != null) + else*/ + if (isset($_SESSION['__pickles']['security']['level']) && $_SESSION['__pickles']['security']['level'] != null) { return $_SESSION['__pickles']['security']['level']; } diff --git a/pickles.php b/pickles.php index f3f03fc..8b6db71 100644 --- a/pickles.php +++ b/pickles.php @@ -140,7 +140,7 @@ function __autoload($class) if ($class == 'AYAH') { - $loaded = require_once PICKLES_VENDOR_PATH . '/ayah/' . $filename; + $loaded = require_once PICKLES_VENDOR_PATH . '/ayah/' . strtolower($filename); } else {