Changeset 28178
- Timestamp:
- 02/22/10 12:08:22 (3 years ago)
- Files:
-
- components/yaml/branches/1.0/lib/sfYamlParser.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
components/yaml/branches/1.0/lib/sfYamlParser.php
r24527 r28178 27 27 { 28 28 protected 29 $value = '',30 29 $offset = 0, 31 30 $lines = array(), … … 55 54 public function parse($value) 56 55 { 57 $this->value = $this->cleanup($value);58 56 $this->currentLineNb = -1; 59 57 $this->currentLine = ''; 60 $this->lines = explode("\n", $this-> value);58 $this->lines = explode("\n", $this->cleanup($value)); 61 59 62 60 $data = array(); … … 199 197 else 200 198 { 201 // one liner? 202 if (1 == count(explode("\n", rtrim($this->value, "\n")))) 199 if (1 == count($this->lines)) 203 200 { 204 201 $value = sfYamlInline::load($this->lines[0]); … … 551 548 $value = str_replace(array("\r\n", "\r"), "\n", $value); 552 549 553 if (!preg_match("#\n$#", $value)) 554 { 555 $value .= "\n"; 556 } 550 // remove trailing newlines 551 $value = rtrim($value, "\n"); 557 552 558 553 // strip YAML header