Commit aab32f84 authored by anon's avatar anon

Use build in clear functions for tokens that is not replaced instead of regexp.

parent cc550270
......@@ -104,10 +104,7 @@ class LinkitPluginEntity extends LinkitPlugin {
function buildDescription($data) {
$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);
), array('clear' => TRUE));
return $description;
}
......
......@@ -92,10 +92,7 @@ abstract class LinkitPlugin implements LinkitPluginInterface {
if (isset($this->profile->data[$this->plugin['name']]['result_description'])) {
$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);
), array('clear' => TRUE));
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