diff --git a/lib/pico.php b/lib/pico.php index 67908e4..c5d73ab 100644 --- a/lib/pico.php +++ b/lib/pico.php @@ -58,8 +58,11 @@ class Pico { $meta = $this->read_file_meta($content); $this->run_hooks('file_meta', array(&$meta)); + + $this->run_hooks('before_parse_content', array(&$content)); $content = $this->parse_content($content); - $this->run_hooks('content_parsed', array(&$content)); + $this->run_hooks('after_parse_content', array(&$content)); + $this->run_hooks('content_parsed', array(&$content)); // Depreciated @ v0.8 // Get all the pages $pages = $this->get_pages($settings['base_url'], $settings['pages_order_by'], $settings['pages_order'], $settings['excerpt_length']); @@ -302,8 +305,11 @@ class Pico { */ private function get_protocol() { - preg_match("|^HTTP[S]?|is",$_SERVER['SERVER_PROTOCOL'],$m); - return strtolower($m[0]); + $protocol = 'http'; + if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off'){ + $protocol = 'https'; + } + return $protocol; } /** diff --git a/plugins/pico_plugin.php b/plugins/pico_plugin.php index a50ea05..314fe91 100644 --- a/plugins/pico_plugin.php +++ b/plugins/pico_plugin.php @@ -12,6 +12,11 @@ class Pico_Plugin { public function plugins_loaded() { + } + + public function config_loaded(&$settings) + { + } public function request_url(&$url) @@ -39,11 +44,6 @@ class Pico_Plugin { } - public function config_loaded(&$settings) - { - - } - public function before_read_file_meta(&$headers) { @@ -52,9 +52,14 @@ class Pico_Plugin { public function file_meta(&$meta) { + } + + public function before_parse_content(&$content) + { + } - public function content_parsed(&$content) + public function after_parse_content(&$content) { }