From 8752540f31c3807664f7b7525a016b02d05c6e55 Mon Sep 17 00:00:00 2001 From: Joshua Sherman Date: Fri, 17 Jan 2014 10:50:59 -0500 Subject: [PATCH 1/5] Fixed the case sensitivity issue on this branch. Just a bug fix, happened months ago but I deleted the branch. --- pickles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { From ed90ee3501b461ddfa58196bab5037749696de20 Mon Sep 17 00:00:00 2001 From: Joshua Sherman Date: Wed, 22 Jan 2014 11:56:17 -0500 Subject: [PATCH 2/5] Fixed issue with profilers always being to true --- classes/Config.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) 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 From d8e6c43868216c29759834f73c4458cf4b5bef11 Mon Sep 17 00:00:00 2001 From: Joshua Sherman Date: Wed, 22 Jan 2014 12:23:56 -0500 Subject: [PATCH 3/5] Added sanity check for loggable_query variable --- classes/Database/PDO/Common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } From 0c3b23941743182b8ab93ceb3d39d1f0882c47e8 Mon Sep 17 00:00:00 2001 From: Joshua Sherman Date: Wed, 22 Jan 2014 12:31:57 -0500 Subject: [PATCH 4/5] Updated preg_match to preg_replace_callback Was throwing a deprecation error, figured it's worth fixing. --- classes/Controller.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); From b82b04b121c7a55a91d654d0daf369d40a1e16d0 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Sat, 12 Sep 2015 11:47:08 -0400 Subject: [PATCH 5/5] Disabled token logic Causing a bunch of shit in scenarios where you want to unauth / reauth a user as the cookie isn't immediately available. Should resolve all of the "You are not properly authenticated" errors we see. --- classes/Security.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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']; }