Changeset 8716
- Timestamp:
- 05/02/08 10:31:07 (5 months ago)
- Files:
-
- branches/1.0/lib/util/sfFillInForm.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/lib/util/sfFillInForm.class.php
r8709 r8716 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 }