Changeset 1433

Show
Ignore:
Timestamp:
12/07/09 13:35:05 (2 years ago)
Author:
benoitg
Message:

Security fix: Fix #674

Location:
trunk/wifidog-auth/wifidog
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/wifidog/classes/NodeList.php

    r1428 r1433  
    7878            require_once(NODE_LIST_CLASSES_DIR . "/NodeList" . $nodeListType . ".php"); 
    7979        } else { 
    80             throw new Exception(_("The node list type '$nodeListType' is not supported!")); 
     80            throw new Exception(sprintf(_("The node list type '%s' is not supported!"), htmlspecialchars($nodeListType))); 
    8181        } 
    8282 
  • trunk/wifidog-auth/wifidog/include/language.php

    r1421 r1433  
    5050        $session = Session::getObject(); 
    5151            //echo "Setting to $_REQUEST[wifidog_language]<br/>"; 
    52         $session->set(SESS_LANGUAGE_VAR, $_REQUEST['wifidog_language']); 
     52        $AVAIL_LOCALE_ARRAY = LocaleList::getAvailableLanguageArray(); 
     53        /* Try to guess the lang */ 
     54        if (!empty($AVAIL_LOCALE_ARRAY[$_REQUEST['wifidog_language']])) { 
     55            $session->set(SESS_LANGUAGE_VAR, $_REQUEST['wifidog_language']); 
     56        } 
     57        else { 
     58            throw new Exception(htmlspecialchars($_REQUEST['wifidog_language'])." is not a valid locale"); 
     59        } 
    5360} 
    5461