It would be straight forward to modify the Search and Replace filter to have that behaviour. Firstly, in includes/filter.php, look for the following code on line 28:
widget_errorGet("search");
...and either comment out or delete that line. That will enable the filter to be configured with an empty Search field.
Next, look for the following code beginning at line 47:
function filter_searchReplaceExec($filter_data,$text)
{
return trim(str_replace($filter_data["search"],$filter_data["replace"],$text));
}
...and REPLACE with this new version to make Search and Replace work as you describe:
function filter_searchReplaceExec($filter_data,$text)
{
if ($filter_data["search"])
{
return trim(str_replace($filter_data["search"],$filter_data["replace"],$text));
}
else
{
return $filter_data["replace"];
}
}
Hi Kevin,
It would be straight forward to modify the Search and Replace filter to have that behaviour. Firstly, in includes/filter.php, look for the following code on line 28:
widget_errorGet("search");
...and either comment out or delete that line. That will enable the filter to be configured with an empty Search field.
Next, look for the following code beginning at line 47:
function filter_searchReplaceExec($filter_data,$text)
{
return trim(str_replace($filter_data["search"],$filter_data["replace"],$text));
}
...and REPLACE with this new version to make Search and Replace work as you describe:
function filter_searchReplaceExec($filter_data,$text)
{
if ($filter_data["search"])
{
return trim(str_replace($filter_data["search"],$filter_data["replace"],$text));
}
else
{
return $filter_data["replace"];
}
}
Hope this helps!
Cheers,
David.