summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/linkit_plugins/linkit-plugin-entity.class.php6
-rw-r--r--plugins/plugin.class.php6
2 files changed, 10 insertions, 2 deletions
diff --git a/plugins/linkit_plugins/linkit-plugin-entity.class.php b/plugins/linkit_plugins/linkit-plugin-entity.class.php
index 961afa8..e4fa678 100644
--- a/plugins/linkit_plugins/linkit-plugin-entity.class.php
+++ b/plugins/linkit_plugins/linkit-plugin-entity.class.php
@@ -102,9 +102,13 @@ class LinkitPluginEntity extends LinkitPlugin {
* @see token_replace()
*/
function buildDescription($data) {
- return token_replace(check_plain($this->conf['result_description']), array(
+ $description = token_replace(check_plain($this->conf['result_description']), array(
$this->plugin['entity_type'] => $data,
));
+
+ // Hide tokens that still haven't been replaced.
+ $description = preg_replace('/\[[^\s\[\]:]*:[^\s\[\]]*\]/x', '', $description);
+ return $description;
}
/**
diff --git a/plugins/plugin.class.php b/plugins/plugin.class.php
index 6e9bc77..30154b1 100644
--- a/plugins/plugin.class.php
+++ b/plugins/plugin.class.php
@@ -90,9 +90,13 @@ abstract class LinkitPlugin implements LinkitPluginInterface {
*/
function buildDescription($data) {
if (isset($this->profile->data[$this->plugin['name']]['result_description'])) {
- return token_replace(check_plain($this->profile->data[$this->plugin['name']]['result_description']), array(
+ $description = token_replace(check_plain($this->profile->data[$this->plugin['name']]['result_description']), array(
$this->plugin_name => $data,
));
+
+ // Hide tokens that still haven't been replaced.
+ $description = preg_replace('/\[[^\s\[\]:]*:[^\s\[\]]*\]/x', '', $description);
+ return $description;
}
}