I am new to Expression Engine and want to make certain that I am programming correctly. I have a plugin which returns some text into a tag. If the text contains ... {site_name} ... then the screen will display the name of the site instead of {site_name} as actual text (which is what I want it to do).
Is there an ‘official’ way around this. (I realise that it is unlikely anyone would enter this but with all the different tags it is always a possibility that someone could enter something that matches one of them).
The function is given below (simplified for this post):
public function userstext()
{
$query = "SELECT utext FROM textfield WHERE user_id=" . $_SESSION['user_id'];
$results = $this->EE->db->query($query);
$utext = $results->row('utext');
return htmlentities($utext);
}Which is called by…
Comments: {exp:memberslounge:userstext}The calling template is not embedded into another template.