From a77fdfa6aa5d237915036c2dc140a9c1a1ea2886 Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Fri, 27 Jul 2012 08:58:27 -0400 Subject: [PATCH 1/5] remove special case for /.well-known/host-meta and add module for /.well-known --- boot.php | 11 +---------- mod/_well_known.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 mod/_well_known.php diff --git a/boot.php b/boot.php index 6a894445ba..0ef0977341 100644 --- a/boot.php +++ b/boot.php @@ -458,6 +458,7 @@ if(! class_exists('App')) { $this->argc = count($this->argv); if((array_key_exists('0',$this->argv)) && strlen($this->argv[0])) { $this->module = str_replace(".", "_", $this->argv[0]); + $this->module = str_replace("-", "_", $this->module); } else { $this->argc = 1; @@ -465,16 +466,6 @@ if(! class_exists('App')) { $this->module = 'home'; } - /** - * Special handling for the webfinger/lrdd host XRD file - */ - - if($this->cmd === '.well-known/host-meta') { - $this->argc = 1; - $this->argv = array('hostxrd'); - $this->module = 'hostxrd'; - } - /** * See if there is any page number information, and initialise * pagination diff --git a/mod/_well_known.php b/mod/_well_known.php new file mode 100644 index 0000000000..155810df36 --- /dev/null +++ b/mod/_well_known.php @@ -0,0 +1,14 @@ +argc > 1) { + switch($a->argv[1]) { + case "host-meta": + hostxrd_init($a); + break; + } + } + http_status_exit(404); + killme(); +} \ No newline at end of file From 672f9fd87fd93a8e93da2958c97646dfa8f8299a Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Fri, 27 Jul 2012 09:02:28 -0400 Subject: [PATCH 2/5] include/plugin: define THISPLUGIN as "addon/$pluginname/$pluginname.php" to make life a litte bit easy to lazy plugin devs like me --- include/plugin.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/include/plugin.php b/include/plugin.php index 8f6d6ea985..3eeb0ccaa8 100644 --- a/include/plugin.php +++ b/include/plugin.php @@ -8,7 +8,10 @@ function uninstall_plugin($plugin){ q("DELETE FROM `addon` WHERE `name` = '%s' ", dbesc($plugin) ); - + + // define THISPLUGIN, make life easy to plugin devs :-) + define("THISPLUGIN", 'addon/' . $plugin . '/' . $plugin . '.php'); + @include_once('addon/' . $plugin . '/' . $plugin . '.php'); if(function_exists($plugin . '_uninstall')) { $func = $plugin . '_uninstall'; @@ -18,9 +21,11 @@ function uninstall_plugin($plugin){ if (! function_exists('install_plugin')){ function install_plugin($plugin) { - // silently fail if plugin was removed + // define THISPLUGIN, make life easy to plugin devs :-) + define("THISPLUGIN", 'addon/' . $plugin . '/' . $plugin . '.php'); + if(! file_exists('addon/' . $plugin . '/' . $plugin . '.php')) return false; logger("Addons: installing " . $plugin); @@ -77,7 +82,10 @@ function reload_plugins() { $pl = trim($pl); $fname = 'addon/' . $pl . '/' . $pl . '.php'; - + + // define THISPLUGIN, make life easy to plugin devs :-) + define("THISPLUGIN", $fname); + if(file_exists($fname)) { $t = @filemtime($fname); foreach($installed as $i) { @@ -163,6 +171,8 @@ function call_hooks($name, &$data = null) { if((is_array($a->hooks)) && (array_key_exists($name,$a->hooks))) { foreach($a->hooks[$name] as $hook) { + // define THISPLUGIN, make life easy to plugin devs :-) + define("THISPLUGIN", $hook[0]); @include_once($hook[0]); if(function_exists($hook[1])) { $func = $hook[1]; From f433158bedee99dd52c47c35e8e19e601027da11 Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Wed, 29 Aug 2012 04:19:15 -0400 Subject: [PATCH 3/5] config: fix get_config and get_pconfig search for serialized array works also if the serialized string contains newlines --- include/config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/config.php b/include/config.php index 1f2a70e5a1..44606e329a 100644 --- a/include/config.php +++ b/include/config.php @@ -68,7 +68,7 @@ function get_config($family, $key, $instore = false) { ); if(count($ret)) { // manage array value - $val = (preg_match("|^a:[0-9]+:{.*}$|", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']); + $val = (preg_match("|^a:[0-9]+:{.*}$|s", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']); $a->config[$family][$key] = $val; return $val; } @@ -162,7 +162,7 @@ function get_pconfig($uid,$family, $key, $instore = false) { ); if(count($ret)) { - $val = (preg_match("|^a:[0-9]+:{.*}$|", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']); + $val = (preg_match("|^a:[0-9]+:{.*}$|s", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']); $a->config[$uid][$family][$key] = $val; return $val; } From ad45d9a78afd98763d954d6f92ba545ab139e03d Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Fri, 31 Aug 2012 03:31:33 -0400 Subject: [PATCH 4/5] quattro: fix live update --- view/theme/quattro/threaded_conversation.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/theme/quattro/threaded_conversation.tpl b/view/theme/quattro/threaded_conversation.tpl index 13c38acb2b..94be864174 100644 --- a/view/theme/quattro/threaded_conversation.tpl +++ b/view/theme/quattro/threaded_conversation.tpl @@ -1,6 +1,6 @@ {{ for $threads as $item }} -
+
{{ if $item.type == tag }} From 51686cce013be95151b5e7795c4f5bc64cce0523 Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Fri, 31 Aug 2012 03:32:10 -0400 Subject: [PATCH 5/5] quattro: remove 'experimental' --- view/theme/quattro/experimental | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 view/theme/quattro/experimental diff --git a/view/theme/quattro/experimental b/view/theme/quattro/experimental deleted file mode 100644 index e69de29bb2..0000000000