Changeset 27755 for branches/1.3
- Timestamp:
- 02/08/10 21:51:02 (1 month ago)
- Files:
-
- branches/1.3/lib/helper/PartialHelper.php (modified) (2 diffs)
- branches/1.3/test/functional/escapingTest.php (modified) (1 diff)
- branches/1.3/test/functional/fixtures/apps/frontend/modules/escaping/actions/actions.class.php (modified) (1 diff)
- branches/1.3/test/functional/fixtures/apps/frontend/modules/escaping/templates/_partial1.php (added)
- branches/1.3/test/functional/fixtures/apps/frontend/modules/escaping/templates/_partial2.php (added)
- branches/1.3/test/functional/fixtures/apps/frontend/modules/escaping/templates/indexSuccess.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.3/lib/helper/PartialHelper.php
r23810 r27755 139 139 $class = sfConfig::get('mod_'.strtolower($moduleName).'_partial_view_class', 'sf').'PartialView'; 140 140 $view = new $class($context, $moduleName, $actionName, ''); 141 $view->setPartialVars( $vars);141 $view->setPartialVars(true === sfConfig::get('sf_escaping_strategy') ? sfOutputEscaper::unescape($vars) : $vars); 142 142 143 143 if ($retval = $view->getCache()) … … 214 214 $class = sfConfig::get('mod_'.strtolower($moduleName).'_partial_view_class', 'sf').'PartialView'; 215 215 $view = new $class($context, $moduleName, $actionName, ''); 216 $view->setPartialVars( $vars);216 $view->setPartialVars(true === sfConfig::get('sf_escaping_strategy') ? sfOutputEscaper::unescape($vars) : $vars); 217 217 218 218 return $view->render(); branches/1.3/test/functional/escapingTest.php
r23902 r27755 17 17 $b = new sfTestBrowser(); 18 18 19 $b-> 20 get('/escaping/on')-> 21 with('request')->begin()-> 22 isParameter('module', 'escaping')-> 23 isParameter('action', 'on')-> 24 end()-> 25 with('response')->begin()-> 26 isStatusCode(200)-> 27 matches('#<h1>Lorem <strong>ipsum</strong> dolor sit amet.</h1>#')-> 28 matches('#<h2>Lorem <strong>ipsum</strong> dolor sit amet.</h2>#')-> 29 end() 19 $b->get('/escaping/on') 20 21 ->with('request')->begin() 22 ->isParameter('module', 'escaping') 23 ->isParameter('action', 'on') 24 ->end() 25 26 ->with('response')->begin() 27 ->isStatusCode(200) 28 ->matches('#<h1>Lorem <strong>ipsum</strong> dolor sit amet.</h1>#') 29 ->matches('#<h2>Lorem <strong>ipsum</strong> dolor sit amet.</h2>#') 30 ->matches('#<h3>Lorem <strong>ipsum</strong> dolor sit amet.</h3>#') 31 ->matches('#<h4>Lorem <strong>ipsum</strong> dolor sit amet.</h4>#') 32 ->matches('#<h5>Lorem <strong>ipsum</strong> dolor sit amet.</h5>#') 33 ->matches('#<h6>Lorem <strong>ipsum</strong> dolor sit amet.</h6>#') 34 ->checkElement('span.no', 2) 35 ->end() 30 36 ; 31 37 32 $b-> 33 get('/escaping/off')-> 34 with('request')->begin()-> 35 isParameter('module', 'escaping')-> 36 isParameter('action', 'off')-> 37 end()-> 38 with('response')->begin()-> 39 isStatusCode(200)-> 40 matches('#<h1>Lorem <strong>ipsum</strong> dolor sit amet.</h1>#')-> 41 matches('#<h2>Lorem <strong>ipsum</strong> dolor sit amet.</h2>#')-> 42 end() 38 $b->get('/escaping/off') 39 40 ->with('request')->begin() 41 ->isParameter('module', 'escaping') 42 ->isParameter('action', 'off') 43 ->end() 44 45 ->with('response')->begin() 46 ->isStatusCode(200) 47 ->matches('#<h1>Lorem <strong>ipsum</strong> dolor sit amet.</h1>#') 48 ->matches('#<h2>Lorem <strong>ipsum</strong> dolor sit amet.</h2>#') 49 ->end() 43 50 ; branches/1.3/test/functional/fixtures/apps/frontend/modules/escaping/actions/actions.class.php
r20546 r27755 20 20 public function executeOn() 21 21 { 22 sfConfig::set('sf_escaping_strategy', 'on');22 sfConfig::set('sf_escaping_strategy', true); 23 23 } 24 24 25 25 public function executeOff() 26 26 { 27 sfConfig::set('sf_escaping_strategy', 'off');27 sfConfig::set('sf_escaping_strategy', false); 28 28 } 29 29 } branches/1.3/test/functional/fixtures/apps/frontend/modules/escaping/templates/indexSuccess.php
r8260 r27755 1 1 <h1><?php echo $var ?></h1> 2 2 <h2><?php echo $sf_data->get('var') ?></h2> 3 4 <?php include_partial('escaping/partial1', array('var' => $var, 'arr' => array())) ?>

