From 587c933112187483fac09fae61a95eae1db84b98 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Sun, 03 Nov 2013 17:36:46 +0000
Subject: [PATCH] 1. Zmiana nazw kanałów AXN (Crime/Sci-Fi -> Black/White) 2. Usunięcie kanału RSS Linux News 3. Inne drobne zmiany (wspierane PHP >= 5.3)

---
 class/legacy/jsarray.php |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/class/legacy/jsarray.php b/class/legacy/jsarray.php
index a3b952d..9961de6 100644
--- a/class/legacy/jsarray.php
+++ b/class/legacy/jsarray.php
@@ -11,8 +11,11 @@
 				// Ignore  < ? php  and  ? >  added above
 				if($token[0] == T_OPEN_TAG OR $token[0] == T_CLOSE_TAG) continue;
 				// String/int element within an array
-				if($token[0] == T_CONSTANT_ENCAPSED_STRING || $token[0] == T_LNUMBER) {
+				if($token[0] == T_CONSTANT_ENCAPSED_STRING) {
 					$element = substr($token[1], 1, -1);
+				}
+				if($token[0] == T_LNUMBER) {
+					$element = $token[1];
 				}
 			}
 			// Nested array
@@ -21,7 +24,7 @@
 			}
 			// End of nested array
 			elseif($token == ']') {
-				// Put elements into the lastest array
+				// Put elements into the latest array
 				if($element !== NULL && $element !== FALSE) {
 					end($stack);
 					$stack[key($stack)][] = $element;
@@ -38,7 +41,7 @@
 			}
 			// Elements separator
 			elseif($token == ',') {
-				// Put elements into the lastest array (]] check)
+				// Put elements into the latest array (]] check)
 				if($element !== FALSE) {
 					end($stack);
 					$stack[key($stack)][] = $element;
@@ -47,11 +50,15 @@
 			}
 			else
 			{
-				return array();
+				return FALSE;
 			}
 		}
 		
-		return $stack[0][0];
+		if(isset($stack[0][0])) {
+			return $stack[0][0];
+		} else {
+			return NULL;
+		}
 	}
 }
 ?>
\ No newline at end of file

--
Gitblit v1.9.1