WordPress.org

Ready to get started?Download WordPress

Forums

[closed] automatic language selection and security holes (2 posts)

  1. jcv
    Member
    Posted 5 years ago #

    Hi all,

    I own a blog mainly in French, but sometimes I also write some English messages. Moreover, most plugins/blog are both languages capable. If I had defined WPLANG to en_EN (config.php file), almost all the blog would be in English.

    Thus, I was wondering why WordPress doesn't implement a fully automated option, which is on my very config.php, for instance, to recognize the user browser language. Google does this. I implemented a code on my blgo to do (part) of this :

    $browserlanguageis = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
    if ( $browserlanguageis == "en" ) {
    define ('WPLANG', 'en_EN');
    } else {
    define ('WPLANG', 'fr_FR');
    }

    which replaces

    define ('WPLANG', 'fr_FR');

    I'm wondering if this code (may) involve any security issue? I can understand WordPress doesn't implement all languages available (it would be a huge waste of space), but I don't know if this kind of piece of code could be a security hole...

    What do you think?

  2. moshu
    Member
    Posted 5 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic