From c29f622b90a58a783787b27736cd9738e6be50c2 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 2 Dec 2015 16:21:15 -0800 Subject: introduce STD_VERSION and get_std_version() [in include/plugin.php], we begin with 0.11.1 since it is an incompatible interface change to 0.11. --- include/plugin.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/plugin.php') diff --git a/include/plugin.php b/include/plugin.php index 8749f3fbf..1d4caac0f 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -616,3 +616,14 @@ function get_markup_template($s, $root = '') { $template = $t->get_markup_template($s, $root); return $template; } + +// return the standardised version. Since we can't easily compare +// before the STD_VERSION definition was applied, we have to treat +// all prior release versions the same. You can dig through them +// with other means (such as RED_VERSION) if necessary. + +function get_std_version() { + if(defined('STD_VERSION')) + return STD_VERSION; + return '0.0.0'; +} -- cgit v1.2.3 From 4cab74c18cf237eae6c57baea2b1d4fd260fe590 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 3 Dec 2015 21:05:48 -0800 Subject: use the channel blacklist for items and mail, still todo: directory and stuff --- include/plugin.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/plugin.php') diff --git a/include/plugin.php b/include/plugin.php index 1d4caac0f..1f4d60736 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -495,6 +495,15 @@ function format_css_if_exists($source) { return '' . "\r\n"; } +/* + * This basically calculates the baseurl. We have other functions to do that, but + * there was an issue with script paths and mixed-content whose details are arcane + * and perhaps lost in the message archives. The short answer is that we're ignoring + * the URL which we are "supposed" to use, and generating script paths relative to + * the URL which we are currently using; in order to ensure they are found and aren't + * blocked due to mixed content issues. + */ + function script_path() { if(x($_SERVER,'HTTPS') && $_SERVER['HTTPS']) $scheme = 'https'; -- cgit v1.2.3 From ed5ca9e4ccb2741c33ac2c88082728066bc715fb Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 18 Dec 2015 14:55:19 -0800 Subject: use realpath to bypass symlinks and check actually directory --- include/plugin.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/plugin.php') diff --git a/include/plugin.php b/include/plugin.php index 1f4d60736..4a35a0170 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -636,3 +636,13 @@ function get_std_version() { return STD_VERSION; return '0.0.0'; } + + +function folder_exists($folder) +{ + // Get canonicalized absolute pathname + $path = realpath($folder); + + // If it exist, check if it's a directory + return (($path !== false) && is_dir($path)) ? $path : false; +} \ No newline at end of file -- cgit v1.2.3