| @@ 572-584 (lines=13) @@ | ||
| 569 | $c = count($vars); |
|
| 570 | $k = trim($vars[0]); |
|
| 571 | $theVar = isset($source) ? $source[$k] : $GLOBALS[$k]; |
|
| 572 | for ($a = 1; $a < $c; $a++) { |
|
| 573 | if (!isset($theVar)) { |
|
| 574 | break; |
|
| 575 | } |
|
| 576 | $key = trim($vars[$a]); |
|
| 577 | if (is_object($theVar)) { |
|
| 578 | $theVar = $theVar->{$key}; |
|
| 579 | } elseif (is_array($theVar)) { |
|
| 580 | $theVar = $theVar[$key]; |
|
| 581 | } else { |
|
| 582 | return ''; |
|
| 583 | } |
|
| 584 | } |
|
| 585 | if (!is_array($theVar) && !is_object($theVar)) { |
|
| 586 | return $theVar; |
|
| 587 | } |
|
| @@ 5060-5070 (lines=11) @@ | ||
| 5057 | $numberOfLevels = count($keys); |
|
| 5058 | $rootKey = trim($keys[0]); |
|
| 5059 | $value = isset($source) ? $source[$rootKey] : $GLOBALS[$rootKey]; |
|
| 5060 | for ($i = 1; $i < $numberOfLevels && isset($value); $i++) { |
|
| 5061 | $currentKey = trim($keys[$i]); |
|
| 5062 | if (is_object($value)) { |
|
| 5063 | $value = $value->{$currentKey}; |
|
| 5064 | } elseif (is_array($value)) { |
|
| 5065 | $value = $value[$currentKey]; |
|
| 5066 | } else { |
|
| 5067 | $value = ''; |
|
| 5068 | break; |
|
| 5069 | } |
|
| 5070 | } |
|
| 5071 | if (!is_scalar($value)) { |
|
| 5072 | $value = ''; |
|
| 5073 | } |
|