From b201de2bd43dce65983ea7faaf4d512a8e41c366 Mon Sep 17 00:00:00 2001 From: Anon Houmous Date: Sat, 21 Apr 2018 11:05:14 +0200 Subject: [PATCH 1/2] Avoid Unitialized string offset notice message --- src/Toml.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Toml.php b/src/Toml.php index 4da5b51..67324d7 100755 --- a/src/Toml.php +++ b/src/Toml.php @@ -399,15 +399,17 @@ private static function normalize($toml) } // Raw Lines - $lineBuffer .= $toml[$i]; - if($toml[$i] == "\n") - { - $lineBuffer = ''; - } + if(!isset($toml[$i])) { + $lineBuffer .= $toml[$i]; + if($toml[$i] == "\n") + { + $lineBuffer = ''; + } - if($keep) - { - $normalized .= $toml[$i]; + if($keep) + { + $normalized .= $toml[$i]; + } } } From 7bd9129e75ee5b40e8005b50ce42a8ed55be67ff Mon Sep 17 00:00:00 2001 From: slashome Date: Sat, 21 Apr 2018 11:43:08 +0200 Subject: [PATCH 2/2] Fix wrong condition --- src/Toml.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Toml.php b/src/Toml.php index 67324d7..9b22f15 100755 --- a/src/Toml.php +++ b/src/Toml.php @@ -399,7 +399,7 @@ private static function normalize($toml) } // Raw Lines - if(!isset($toml[$i])) { + if(isset($toml[$i])) { $lineBuffer .= $toml[$i]; if($toml[$i] == "\n") {