Problems when logging in

Asked by lundern

Hello.

I've installed the CMS following the install guide very closely. I've CHMODed the config.php and all, but I still get this message after 3 reinstalls:

Fatal error: Call to undefined function: htmlspecialchars_decode() in /hsphere/local/home/lundern/lundern.net/2009/phpns/inc/function.php on line 147

My webserver supports PHP5 and everything else that I need.

Thanks in advance, yours truly,
Ole Marius

Question information

Language:
English Edit question
Status:
Solved
For:
phpns Edit question
Assignee:
No assignee Edit question
Solved by:
lundern
Solved:
Last query:
Last reply:
Revision history for this message
lundern (ole-lundern) said :
#1

function decode_data($data) {
  if (is_array($data)) {
   foreach ($data as $key => $value) {
    $data[$key] = htmlspecialchars_decode($value);
   }
  } else {
   $data = htmlspecialchars_decode($data);
  }
  return $data;
 }

This is the code where it happens. (the error)

Revision history for this message
lundern (ole-lundern) said :
#2

Solved it by digging deeper into answers on this site. I replaced the code with:

function htmlspecialchars_decode($str) {
    return strtr($str,
array_flip(get_html_translation_table(HTML_SPECIALCHARS)));
}

I then tried relogging and I got another message, I then went on to themecontrol.php and replaced decode_data with htmlspecialschars_decode in this code:

if (trim($global_message['v3']) != NULL) {
    $important_notice = '<div class="global_message"><div class="global_message_link"><a href="preferences.php?do=globalmessage">[Change Message]</a></div><div class="global_message_text">'.decode_data($global_message['v3']).'</div></div>';
   }

Line 96 through 98.