I found a logical error on OpenLiteSpeed webadmin Console

#1
Version:1.4.41
File:/usr/local/lsws/admin/html.open/lib/DMsg.php

line 38 to 46

orign code is

Code:
        $msgfile = SERVER_ROOT . self::LANG_DIR . 'en-US_msg.php';
        if (file_exists($msgfile)) {
            // maybe called from command line for converter tool
            include $msgfile;
            if ($lang != DMsg:: DEFAULT_LANG) {
                include SERVER_ROOT . self::LANG_DIR . $filecode . '_msg.php';
            }
        }
I think It's better to change to

Code:
        $msgfile = SERVER_ROOT . self::LANG_DIR . $filecode . '_msg.php';
        if (file_exists($msgfile)) {
            include $msgfile;
        }else{
            include SERVER_ROOT . self::LANG_DIR . 'en-US_msg.php';
        }
 
#2
Hi, Ruisheng,

I'm glad that you looked into that level of details. The reason we are doing that is: the language translation is not complete. So the actual translated file contains less entries then the English one. That's why the English file was always loaded first, then if there's translation, it will override the English one, if not, English will be used.

Would like to help more on this open source project?

You are welcome to join our slack https://goo.gl/FG9S4N

Thanks,
Lauren
 
#3
It's better change it to

Code:
        $msgfile = SERVER_ROOT . self::LANG_DIR . 'en-US_msg.php';
        if (file_exists($msgfile)) {
            include $msgfile;
            if ($filecode != 'en-US') {
                include SERVER_ROOT . self::LANG_DIR . $filecode . '_msg.php';
            }
        }
so that, we can set custom default language.
 
Top