Development

#1617: sfExecutionFilter.class.php.patch

You must first sign up to be able to contribute.

Ticket #1617: sfExecutionFilter.class.php.patch

File sfExecutionFilter.class.php.patch, 2.0 kB (added by Carl.Vondrick, 2 years ago)

Alternative patch that eliminates naming conflict

  • lib/filter/sfExecutionFilter.class.php

    old new  
    7171        // set default validated status 
    7272        $validated = true; 
    7373 
     74        // the case of the first letter of the action is insignificant 
     75        $actionNameLower = strtolower(substr($actionName, 0, 1)).substr($actionName, 1); 
     76        $actionNameUpper = ucfirst($actionName); 
     77 
    7478        // get the current action validation configuration 
    75         $validationConfig = $moduleName.'/'.sfConfig::get('sf_app_module_validate_dir_name').'/'.$actionName.'.yml'; 
     79        $validationConfigLower = $moduleName.'/'.sfConfig::get('sf_app_module_validate_dir_name').'/'.$actionNameLower.'.yml'; 
     80        $validationConfigUpper = $moduleName.'/'.sfConfig::get('sf_app_module_validate_dir_name').'/'.$actionNameUpper.'.yml'; 
    7681 
     82        // determine $validateFile by testing both the uppercase and lowercase 
     83        // types of validation configurations. 
     84        if (null !== $testValidateFile = sfConfigCache::getInstance()->checkConfig(sfConfig::get('sf_app_module_dir_name').'/'.$validationConfigLower, true)) 
     85        { 
     86          $validateFile = $testValidateFile; 
     87        } 
     88        elseif (null !== $testVaidateFile = sfConfigCache::getInstance()->checkConfig(sfConfig::get('sf_app_module_dir_name').'/'.$validationConfigUpper, true)) 
     89        { 
     90          $validateFile = $testValidateFile; 
     91        } 
     92        else 
     93        { 
     94          $validateFile = null; 
     95        } 
     96 
    7797        // load validation configuration 
    7898        // do NOT use require_once 
    79         if (null !== $validateFile = sfConfigCache::getInstance()->checkConfig(sfConfig::get('sf_app_module_dir_name').'/'.$validationConfig, true)
     99        if (null !== $validateFile
    80100        { 
    81101          // create validator manager 
    82102          $validatorManager = new sfValidatorManager(); 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.