Topic: PHP Warning: Missing argument 1 for pun_htmlspecialchars

How should I solve this error message?
Server is: Apache 2.0 PHP 5.2 Mysql 5

PHP Warning:  Missing argument 1 for pun_htmlspecialchars(), called in /home/******l/public_html/forum/header.php on line 148 and defined in /home/******/public_html/forum/include/functions.php on line 725

Re: PHP Warning: Missing argument 1 for pun_htmlspecialchars

Line 148 in an unmodified copy of PunBB is a comment, so you'll need to paste your code here wink

Re: PHP Warning: Missing argument 1 for pun_htmlspecialchars

Solved:
The lines 147-149 (OLD)


// START SUBST - <pun_title>
$tpl_main = str_replace('<pun_title>', '<h1><span>'.pun_htmlspecialchars().'</span></h1>', $tpl_main);
// END SUBST - <pun_title>

I changed to :

// START SUBST - <pun_title>
$tpl_main = str_replace('<pun_title>', '<h1><span>'.pun_htmlspecialchars($pun_config['']).'</span></h1>', $tpl_main);
// END SUBST - <pun_title>

4

Re: PHP Warning: Missing argument 1 for pun_htmlspecialchars

Just out of curiosity, why don't you either just comment that line out or hide the board title with CSS? The way you have done it is silly.

Re: PHP Warning: Missing argument 1 for pun_htmlspecialchars

Indeed, all you're doing that way is adding an empty h1 and span (and, if PunBB was using E_ALL, I think that would give a notice).

6

Re: PHP Warning: Missing argument 1 for pun_htmlspecialchars

Commenting it out would also require the replaced item to be removed from main.tpl otherwise the validator would throw a hissy fit.

7 (edited by swdtech 2007-10-15 19:38)

Re: PHP Warning: Missing argument 1 for pun_htmlspecialchars

First off it is not mine forum, I don't know what the forum owner has done with all files etc.

I asked for help to remove the error message, nothing else. The error message is gone now. And now I can check the config if needed. all PHP error reporting is on and no error is reported. I know there is a empty tag but that one doesn't fill up discspace with error logs.

8

Re: PHP Warning: Missing argument 1 for pun_htmlspecialchars

It's still a bloody silly way to do it.