Changeset 27989
- Timestamp:
- 02/12/10 22:53:20 (2 years ago)
- Files:
-
- branches/1.2/lib/widget/sfWidgetFormSelectCheckbox.class.php (modified) (1 diff)
- branches/1.2/lib/widget/sfWidgetFormSelectRadio.class.php (modified) (1 diff)
- branches/1.2/test/unit/widget/sfWidgetFormSelectCheckboxTest.php (modified) (2 diffs)
- branches/1.2/test/unit/widget/sfWidgetFormSelectRadioTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.2/lib/widget/sfWidgetFormSelectCheckbox.class.php
r17068 r27989 112 112 $inputs[] = array( 113 113 'input' => $this->renderTag('input', array_merge($baseAttributes, $attributes)), 114 'label' => $this->renderContentTag('label', $option, array('for' => $id)),114 'label' => $this->renderContentTag('label', self::escapeOnce($option), array('for' => $id)), 115 115 ); 116 116 } branches/1.2/lib/widget/sfWidgetFormSelectRadio.class.php
r17068 r27989 107 107 $inputs[] = array( 108 108 'input' => $this->renderTag('input', array_merge($baseAttributes, $attributes)), 109 'label' => $this->renderContentTag('label', $option, array('for' => $id)),109 'label' => $this->renderContentTag('label', self::escapeOnce($option), array('for' => $id)), 110 110 ); 111 111 } branches/1.2/test/unit/widget/sfWidgetFormSelectCheckboxTest.php
r17068 r27989 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(1 0, new lime_output_color());13 $t = new lime_test(11, new lime_output_color()); 14 14 15 15 $dom = new DomDocument('1.0', 'utf-8'); … … 83 83 $t->is(count($css->matchAll('input[type="checkbox"]')->getNodes()), 3, '->render() accepts a sfCallable as a choices option'); 84 84 85 // choices are escaped 86 $t->diag('choices are escaped'); 87 88 $w = new sfWidgetFormSelectCheckbox(array('choices' => array('<b>Hello world</b>'))); 89 $t->is($w->render('foo'), '<ul class="checkbox_list"><li><input name="foo[]" type="checkbox" value="0" id="foo_0" /> <label for="foo_0"><b>Hello world</b></label></li></ul>', '->render() escapes the choices'); 90 85 91 // __clone() 86 92 $t->diag('__clone()'); branches/1.2/test/unit/widget/sfWidgetFormSelectRadioTest.php
r17068 r27989 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test( 9, new lime_output_color());13 $t = new lime_test(10, new lime_output_color()); 14 14 15 15 $dom = new DomDocument('1.0', 'utf-8'); … … 78 78 $t->is(count($css->matchAll('input[type="radio"]')->getNodes()), 3, '->render() accepts a sfCallable as a choices option'); 79 79 80 // choices as escaped 81 $t->diag('choices are escaped'); 82 83 $w = new sfWidgetFormSelectRadio(array('choices' => array('<b>Hello world</b>'))); 84 $t->is($w->render('foo'), '<ul class="radio_list"><li><input name="foo" type="radio" value="0" id="foo_0" /> <label for="foo_0"><b>Hello world</b></label></li></ul>', '->render() escapes the choices'); 85 80 86 // __clone() 81 87 $t->diag('__clone()');