Ticket #3232: sfValidatorConfigHandler.class.patch
| File sfValidatorConfigHandler.class.patch, 1.5 kB (added by FabianLange, 8 months ago) |
|---|
-
sfValidatorConfigHandler.class.php
old new 45 45 { 46 46 if (!isset($config[$category])) 47 47 { 48 throw new sfParseException(sprintf('Configuration file "%s" is missing "%s" category', $configFiles[0], $category)); 48 if (!isset($config['fillin'])) 49 { 50 throw new sfParseException(sprintf('Configuration file "%s" is missing "%s" category', $configFiles[0], $category)); 51 } 52 $config[$category] = array(); 49 53 } 50 54 } 51 55 … … 97 101 $data[] = "if (\$_SERVER['REQUEST_METHOD'] == 'GET')"; 98 102 $data[] = "{"; 99 103 100 $ ret = $this->generateRegistration('GET', $data, $methods, $names, $validators);104 $this->generateRegistration('GET', $data, $methods, $names, $validators); 101 105 102 if ( $ret)106 if (count($fillin)) 103 107 { 104 108 $data[] = sprintf(" \$context->getRequest()->setAttribute('fillin', %s, 'symfony/filter');", $fillin); 105 109 } … … 110 114 $data[] = "else if (\$_SERVER['REQUEST_METHOD'] == 'POST')"; 111 115 $data[] = "{"; 112 116 113 $ ret = $this->generateRegistration('POST', $data, $methods, $names, $validators);117 $this->generateRegistration('POST', $data, $methods, $names, $validators); 114 118 115 if ( $ret)119 if (count($fillin)) 116 120 { 117 121 $data[] = sprintf(" \$context->getRequest()->setAttribute('fillin', %s, 'symfony/filter');", $fillin); 118 122 }