Ticket #592: 592-jForms-GET-method.2.diff

File 592-jForms-GET-method.2.diff, 2.3 kB (added by Julien, 8 months ago)

good patch

  • lib/jelix/plugins/tpl/html/block.form.php

    old new  
    5757    else 
    5858        $helpdecorator = "'jFormsHelpDecoratorAlert'"; 
    5959 
    60     $method = strtolower(isset($param[5])?$param[5]:'post'); 
    61     if($method!='get' && $method!='post') 
    62         $method='post'; 
     60    if(!isset($param[5]) || !$param[5] || $param[5] == '""' || $param[5] == '\'\'') 
     61        $method = '\'post\''; 
     62    else 
     63        $method = strtolower($param[5]); 
    6364 
    6465    $content = ' $t->_privateVars[\'__form\'] = '.$param[0].'; 
    6566$t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder(\'html\'); 
    6667$t->_privateVars[\'__formbuilder\']->setAction('.$param[1].','.$param[2].'); 
    67 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.',\''.$method.'\')); 
     68$t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.','.$method.')); 
    6869$t->_privateVars[\'__displayed_ctrl\'] = array(); 
    6970'; 
    7071        $compiler->addMetaContent('if(isset('.$param[0].')) { '.$param[0].'->getBuilder(\'html\')->outputMetaContent($t);}'); 
  • lib/jelix/plugins/tpl/html/cfunction.formfull.php

    old new  
    4747    else 
    4848        $helpdecorator = "'jFormsHelpDecoratorAlert'"; 
    4949 
    50     $method = strtolower(isset($params[5])?$params[5]:'post'); 
    51     if($method!='get' && $method!='post') 
    52         $method='post'; 
     50    if(!isset($params[5]) || !$params[5] || $params[5] == '""' || $params[5] == '\'\'') 
     51        $method = '\'post\''; 
     52    else 
     53        $method = strtolower($params[5]); 
    5354 
    5455    $content = ' $formfull = '.$params[0].'; 
    5556    $formfullBuilder = $formfull->getBuilder(\'html\'); 
    5657    $formfullBuilder->setAction('.$params[1].','.$params[2].'); 
    57     $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.',\''.$method.'\')); 
     58    $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.','.$method.')); 
    5859    $formfullBuilder->outputAllControls(); 
    5960    $formfullBuilder->outputFooter();'; 
    6061 
Download in other formats: Original Format