OSDN Git Service

カレンダーライブラリ修正。
authornaoki hirata <naoki@magic3.org>
Tue, 16 Jan 2018 01:31:24 +0000 (10:31 +0900)
committernaoki hirata <naoki@magic3.org>
Tue, 16 Jan 2018 01:31:24 +0000 (10:31 +0900)
include/lib/Calendar-0.5.5/Calendar.php

index 59a224d..32ec15c 100644 (file)
@@ -405,13 +405,24 @@ class Calendar
      */
     function fetch()
     {
-        $child = each($this->children);
+/*        $child = each($this->children);
         if ($child) {
             return $child['value'];
         } else {
             reset($this->children);
             return false;
         }
+               */
+               // PHP7.2非奨励のeach()を置き換え
+               $key = key($this->children);
+               if ($key){
+                       $value = $this->children[$key];
+                       next($this->children);
+                       return $value;
+               } else {
+                       reset($this->children);
+                       return false;
+               }
     }
 
     /**