Extension talk:CorrectMainPageTitle

you can custom the title
replace wfMsg('pagetitle-view-mainpage') with a string ( for example: 'My html title for Main Page' ) —The preceding unsigned comment was added by Superxain (talk • contribs) 13:41, 14 September 2010 (UTC). Please sign your posts with ~ !
 * It's better if you edit the MediaWiki:Pagetitle-view-mainpage system message, because it is intended to be the main page title, but for some reason it doesn't work out-of-the-box without my extension (I've installed MediaWiki in Italian). -- 15:23, 15 September 2010 (UTC)

Error in object to string conversion and quick fix
VittGam, thank you for the simple yet important extension. This had been an issue at our wiki too, and your extension fixed it. However, your code didn't work for me out-of-the-box. In my enviroment (PHP 5.1.6, MW 1.16.0), the following error was reported and the title did not change: Notice: Object of class Title could not be converted to int in (...)extensions/CorrectMainPageTitle.php on line 28 The problem was in the line: if (in_array(strtolower($request->getText('action')),array( '' ,'view','print','submit','purge')) && $title==wfMsg('mainpage')) { I've bolded the relevant part. $title is an object, and wfMsg('mainpage') is a string. So I changed that part to make it work; which is, $title->getText == wfMsg('mainpage') Moreover, people say that you should use "===" or strcmp when comparing strings, so I ended up with $title->getText === wfMsg('mainpage') (Note: This is my first time I've meddled with PHP code, so I'm not sure if I'm doing it right.)

I hope this helps anyone who's having a similar issue. --朝彦 (Asahiko) 07:04, 9 October 2010 (UTC)
 * You are right; it works in both ways on my wiki, but your method is the correct one. Thank you for the fix. -- 15:03, 14 October 2010 (UTC)