Current time: 07-24-2014, 06:25 AM Hello There, Guest! (LoginRegister)


 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] config_spiders.lang.php overrides $lang->language [C-sayakb]
04-24-2009, 04:32 PM (This post was last modified: 04-24-2009 05:36 PM by frostschutz.)
Post: #1
[F] config_spiders.lang.php overrides $lang->language [C-sayakb]
This user has been denied support. This user has been denied support.
The file config_spiders.lang.php contains this entry:

PHP Code:
config_spiders.lang.php:$l['language'] = "Language"

This overrides the $lang->language value which is used by $lang->load() to determine the folder in which to look for language files:

PHP Code:
/**/
    
function load($section$isdatahandler=false$supress_error=false)
    {
        
// Assign language variables.
        // Datahandlers are never in admin lang directory.
        
if($isdatahandler === true)
        {
            
$this->language str_replace('/admin'''$this->language);
        }
        
$lfile $this->path."/".$this->language."/".$section.".lang.php"

So it seems because $lang internal variables like current language, path, etc. as well as the language strings themselves are stored in the same object, it must be ensured that these do not collide, i.e. there mustn't be an $l['path'] or $l['language'] (and probably others, haven't read all of the code) in any of the language files.

This doesn't cause errors in normal operation because the config_spiders.lang.php happens to be the last language file being loaded during a request. However if a plugin tries to load another language file after that, it will fail with file not found errors, because $lang tries to load inc/languages/Language/..., Language being the value of $l['language'] of config_spiders.lang.php.



I'll avoid this problem by moving my $lang->load() statements to more specific hooks in my plugin.

Google SEO | Gravatar | Hooks | HTMLPurifier | Overview | Patches | PluginLibrary @ GitHub/frostschutz
Find all posts by this user
04-25-2009, 03:49 AM
Post: #2
[F] config_spiders.lang.php overrides $lang->language
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group
Visit this user's website Find all posts by this user


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication