Changeset 8723
- Timestamp:
- 05/02/08 19:09:05 (7 months ago)
- Files:
-
- branches/dwhittle/1.0/lib/helper/JavascriptHelper.php (modified) (1 diff)
- branches/dwhittle/1.0/lib/util/sfFillInForm.class.php (modified) (1 diff)
- branches/dwhittle/1.0/lib/validator/sfUrlValidator.class.php (modified) (1 diff)
- branches/dwhittle/1.0/test/unit/validator/sfUrlValidatorTest.php (modified) (3 diffs)
- branches/dwhittle/1.1/lib/helper/JavascriptHelper.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/helper/ObjectAdminHelper.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/lib/util/sfFillInForm.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/dwhittle/1.0/lib/helper/JavascriptHelper.php
r6598 r8723 931 931 $js_options['afterUpdateElement'] = $options['after_update_element']; 932 932 } 933 if (isset($options['param_name'])) 934 { 935 $js_options['paramName'] = "'".$options['param_name']."'"; 936 } 933 937 934 938 $javascript .= ', '._options_for_javascript($js_options).');'; branches/dwhittle/1.0/lib/util/sfFillInForm.class.php
r8713 r8723 44 44 { 45 45 $dom = new DomDocument('1.0', sfConfig::get('sf_charset', 'UTF-8')); 46 47 $noHead = strpos($html,'<head>') === false; 48 if ($noHead){ 49 //loadHTML needs the conent-type meta for the charset 50 $html = '<meta http-equiv="Content-Type" content="text/html; charset='.sfConfig::get('sf_charset').'"/>'.$html; 51 } 52 46 53 @$dom->loadHTML($html); 47 48 54 $dom = $this->fillInDom($dom, $formName, $formId, $values); 49 55 56 if($noHead){ 57 //remove the head element that was created by adding the meta tag. 58 $headElement = $dom->getElementsByTagName('head')->item(0); 59 if ($headElement) 60 { 61 $dom->getElementsByTagName('html')->item(0)->removeChild($headElement); 62 } 63 } 50 64 return $dom->saveHTML(); 51 65 } branches/dwhittle/1.0/lib/validator/sfUrlValidator.class.php
r6598 r8723 29 29 public function execute(&$value, &$error) 30 30 { 31 $re = '/^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)/i'; 32 31 $re = '~^ 32 (https?|ftp):// # http or https or ftp 33 ( 34 ([a-z0-9-]+\.)+[a-z]{2,6} # a domain name 35 | # or 36 \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # a IP address 37 ) 38 (:[0-9]+)? # a port (optional) 39 (/?|/\S+) # a /, nothing or a / with something 40 $~ix'; 33 41 if (!preg_match($re, $value)) 34 42 { branches/dwhittle/1.0/test/unit/validator/sfUrlValidatorTest.php
r6598 r8723 12 12 require_once($_test_dir.'/unit/sfContextMock.class.php'); 13 13 14 $t = new lime_test( 12, new lime_output_color());14 $t = new lime_test(22, new lime_output_color()); 15 15 16 16 $context = new sfContext(); … … 26 26 'http://www.symfony-project.com/', 27 27 'ftp://www.symfony-project.com/file.tgz', 28 'http://www.google.com:8080', 29 'http://192.168.1.1', 28 30 ); 29 31 … … 31 33 'google.com', 32 34 'http:/google.com', 35 'http://www.symfony-project,com/', 36 'http://www.symfony-project@com', 37 'http://www.symfony-project@com foobar', 33 38 ); 34 39 branches/dwhittle/1.1/lib/helper/JavascriptHelper.php
r8501 r8723 952 952 { 953 953 $javascript = "new Ajax.Autocompleter("; 954 if (isset($options['param_name'])) 955 { 956 $js_options['paramName'] = "'".$options['param_name']."'"; 957 } 954 958 955 959 $javascript .= "'".get_id_from_name($field_id)."', "; branches/dwhittle/1.1/lib/helper/ObjectAdminHelper.php
r8331 r8723 108 108 $label_all, 109 109 $select1, 110 submit_image_tag(sfConfig::get('sf_admin_web_dir').'/images/next.png', "style=\"border: 0\" onclick=\"double_list_move('{$name1} ), '{$name2}'); return false;\""),110 submit_image_tag(sfConfig::get('sf_admin_web_dir').'/images/next.png', "style=\"border: 0\" onclick=\"double_list_move('{$name1}', '{$name2}'); return false;\""), 111 111 submit_image_tag(sfConfig::get('sf_admin_web_dir').'/images/previous.png', "style=\"border: 0\" onclick=\"double_list_move('{$name2}', '{$name1}'); return false;\""), 112 112 $label_assoc, branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/lib/util/sfFillInForm.class.php
r8713 r8723 44 44 { 45 45 $dom = new DomDocument('1.0', sfConfig::get('sf_charset', 'UTF-8')); 46 47 $noHead = strpos($html,'<head>') === false; 48 if ($noHead){ 49 //loadHTML needs the conent-type meta for the charset 50 $html = '<meta http-equiv="Content-Type" content="text/html; charset='.sfConfig::get('sf_charset').'"/>'.$html; 51 } 52 46 53 @$dom->loadHTML($html); 47 48 54 $dom = $this->fillInDom($dom, $formName, $formId, $values); 49 55 56 if($noHead){ 57 //remove the head element that was created by adding the meta tag. 58 $headElement = $dom->getElementsByTagName('head')->item(0); 59 if ($headElement) 60 { 61 $dom->getElementsByTagName('html')->item(0)->removeChild($headElement); 62 } 63 } 50 64 return $dom->saveHTML(); 51 65 }