From 7c5d283e66e09c3935fbdc45bf97469c5347a5b5 Mon Sep 17 00:00:00 2001 From: Shin Ohno Date: Mon, 12 Oct 2015 10:02:25 +0900 Subject: [PATCH] Update Sheet.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PHP Notice で `undefined index` が出てしまうので、isset チェックを付けました。 また、確実に `this->items[$r]` が確実に配列か nul なのであれば、 is_array の代わりに isset としてしまう方が良かったかもですが、どうでしょう。 --- src/Google/Spreadsheet/Sheet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Google/Spreadsheet/Sheet.php b/src/Google/Spreadsheet/Sheet.php index 0dfc549..f72badd 100644 --- a/src/Google/Spreadsheet/Sheet.php +++ b/src/Google/Spreadsheet/Sheet.php @@ -141,7 +141,7 @@ private function process($entry){ continue; } if($this->fields[$c]){ - $this->items[$r] = is_array($this->items[$r]) ? $this->items[$r] : array(); + $this->items[$r] = isset($this->items[$r]) && is_array($this->items[$r]) ? $this->items[$r] : array(); $this->items[$r][$this->fields[$c]] = $content; } }