From 0e7f2efdb161db0b907ea0cdfc547ca8f348271e Mon Sep 17 00:00:00 2001 From: 0x20h Date: Tue, 15 Feb 2011 21:21:39 +0100 Subject: [PATCH] Fixing notice errors caused by accessing headers in po files that don't exist. Fixes #1515 Signed-off-by: mark_story --- cake/libs/i18n.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index f1234d46a..3fb94f336 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -321,8 +321,10 @@ class I18n extends Object { $this->__domains[$domain][$this->__lang][$this->category] = array(); return $domain; } - - if ($head = $this->__domains[$domain][$this->__lang][$this->category][""]) { + + if (isset($this->__domains[$domain][$this->__lang][$this->category][""])) { + $head = $this->__domains[$domain][$this->__lang][$this->category][""]; + foreach (explode("\n", $head) as $line) { $header = strtok($line,":"); $line = trim(strtok("\n"));