I'm trying to use the Filtered HTML input format to prevent layout tags from getting in my custom front_page display and messing up the layout. However, it seems that somehow input formats are not working to prevent tags like
from being posted into or displayed from a given node. Here is an example of code I'm using:
node_teaser($nodeloaded->flexinode_6, "Filtered HTML")
$teaser = substr(node_teaser($nodeloaded->flexinode_6, "Filtered HTML"),0,140);
Filtered HTML is the default input format, by the way. I've tried specifying or not specifying the format.
Because for whatever reason node_teaser is not applying the input format when creating the teaser. So I've resorted to using this:
$search = array ('@<div[^>]*?>@i', '@<p[^>]*?>@i', '@<table[^>]*?>@i', '@<td[^>]*?>@i', '@<tr[^>]*?>@i', '@</div[^>]*?>@i', '@</p[^>]*?>@i', '@</table[^>]*?>@i', '@</td[^>]*?>@i', '@</tr[^>]*?>@i');
$replace = array ('','','','','','','','','','');
$teaser = substr(preg_replace($search, $replace, node_teaser($nodeloaded->flexinode_6, "Filtered HTML")),0,140);
But this solution is not ideal because it is piecemeal blocking bad stuff, rather than blocking all and then allowing only acceptable stuff.
The reason I'm not just pulling the teaser text out of the database ($node->teaser) is because I don't want to use the flexinode default display of information (field description followed by field content).