Commit cc550270 authored by anon's avatar anon

Fixed #1871014 Remove unreplaced tokens

parent 11c50b8d
......@@ -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;
}
/**
......
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment