Changeset 336

Show
Ignore:
Timestamp:
12/20/06 10:38:12 (2 years ago)
Author:
laurentj
Message:

fix bug : il etait possible d executer une action qui ne correspondait pas au type de la requete

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/jelix/core/jSelector.class.php

    r334 r336  
    170170 * Action selector 
    171171 * 
    172  * main syntax: "module~action:requestType". module should be a valid module name or # (#=says to get 
     172 * main syntax: "module~action@requestType". module should be a valid module name or # (#=says to get 
    173173 * the module of the current request). action should be an action name (controller_method). 
    174174 * all part are optional, but it should have one part at least. 
     
    183183    protected $_dirname='actions/'; 
    184184 
    185     function __construct($sel){ 
     185    /** 
     186     * @param string $sel  the selector 
     187     * @param boolean $enableRequestPart true if the selector can contain the request part 
     188     */ 
     189    function __construct($sel, $enableRequestPart = false){ 
    186190        global $gJCoord; 
    187191 
     
    211215            } 
    212216            $this->resource = $this->controller.'_'.$this->method; 
    213             if($m[3] != ''
     217            if($m[3] != '' && $enableRequestPart
    214218                $this->request = $m[3]; 
    215219            else 
  • trunk/lib/jelix/core/url/jUrl.class.php

    r334 r336  
    258258    static function get ($actSel, $params = array (), $what=0) { 
    259259 
    260         $sel = new JSelectorAct($actSel); 
     260        $sel = new jSelectorAct($actSel,true); 
    261261        $params['module'] = $sel->module; 
    262262        $params['action'] = $sel->resource; 
     
    290290    */ 
    291291    static function getAction ($actionSelector){ 
    292         $sel = new JSelectorAct($actionSelector); 
     292        $sel = new jSelectorAct($actionSelector,true); 
    293293        return array('module'=>$sel->module, 'action'=>$sel->resource, 'request'=>$sel->request); 
    294294    } 
  • trunk/testapp/modules/unittest/classes/utselectoract.class.php

    r231 r336  
    8989            $valid=true; 
    9090            try{ 
    91                 $s = new jSelectorAct($sel); 
     91                $s = new jSelectorAct($sel, true); 
    9292            }catch(jExceptionSelector $e){ 
    9393                $valid=false; 
Download in other formats: Unified Diff Zip Archive