1 (edited by Alex007 2008-03-09 19:22)

Topic: [Bug]: no headers in messages in install.php

Look at file install.php

There are many messages, which have no headers:

if (file_exists(PUN_ROOT.'config.php'))
    exit('The file \'config.php\' already exists which would mean that PunBB is already installed. You should go <a href="index.php">here</a> instead.');

(lines 34-35)

if (!function_exists('version_compare') || version_compare(PHP_VERSION, MIN_PHP_VERSION, '<'))
    exit('You are running PHP version '.PHP_VERSION.'. PunBB requires at least PHP '.MIN_PHP_VERSION.' to run properly. You must upgrade your PHP installation before you can continue.');

(lines 39-40)

etc.

In Gecko browsers these messages are shown in ISO encode, so, if I use some symbols in UTF-8, they won't be shown correct. Fix it please:

if (file_exists(PUN_ROOT.'config.php'))
    {
    header('Content-Type: text/html; charset=utf-8');
    exit('The file \'config.php\' already exists which would mean that PunBB is already installed. You should go <a href="index.php">here</a> instead.');
    }
if (!function_exists('version_compare') || version_compare(PHP_VERSION, MIN_PHP_VERSION, '<'))
    {
    header('Content-Type: text/html; charset=utf-8');
    exit('You are running PHP version '.PHP_VERSION.'. PunBB requires at least PHP '.MIN_PHP_VERSION.' to run properly. You must upgrade your PHP installation before you can continue.');
    }

P.S. It seems to me, that PunBB 1.3 can work only with english as default language...

Re: [Bug]: no headers in messages in install.php

for 1.3 there is only one languages file. once its released other languages will be made.

Re: [Bug]: no headers in messages in install.php

Why would those messages need to show UTF-8 characters?

Re: [Bug]: no headers in messages in install.php

Why would those messages need to show UTF-8 characters?

Because in other way national charachters will not be shown correctly.

Re: [Bug]: no headers in messages in install.php

They're installation error messages. There is no need for other languages there. Would be utterly useless.

6 (edited by Mpok 2008-03-09 23:27)

Re: [Bug]: no headers in messages in install.php

Well, as install.php NOW exists in lang pack, it should exactly serve this purpose : localizing installation.
So the hardcoded strings mentioned by Alex007 should be in the '$lang_install[XXX]' form, in order for us to translate these messages in the lang pack.

However, it's also true that this would not solve totally the problem (cause use of exit()).
So, maybe the simple 'error()' function should also be used as 'error()' do sends correct headers.

Re: [Bug]: no headers in messages in install.php

You cannot access the database, nor can you access the config file. How would you suggest these error messages be localised? Through magic?

Re: [Bug]: no headers in messages in install.php

Mpok: Very correct analysis of the problem smile

9

Re: [Bug]: no headers in messages in install.php

elbekko wrote:

You cannot access the database, nor can you access the config file. How would you suggest these error messages be localised? Through magic?

Just add a "select language" box at the beginning of install, then load the appropriate lang pack.