From 97bc61c05186b3ab28108fe4b1ad06e06a16ce62 Mon Sep 17 00:00:00 2001
From: Dell Sala <dellsala@avtech.com>
Date: Tue, 17 Jan 2017 10:21:19 -0500
Subject: [PATCH] Fixes issue #3620. Change to the Spyc library to correctly
 convert hex strings to ints.

---
 include/Spyc.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/Spyc.php b/include/Spyc.php
index e92a4bece..33dfca907 100644
--- a/include/Spyc.php
+++ b/include/Spyc.php
@@ -615,10 +615,12 @@ class Spyc {
       return false;
     }
 
+    if (is_string($value) && preg_match('/^0x[0-9a-fA-F]+$/', $value)) {
+      return hexdec($value);
+    }
+
     if (is_numeric($value)) {
       if ($value === '0') return 0;
-      if (stripos($value, '0x') === 0)
-        $value = hexdec($value);
       if (rtrim ($value, 0) === $value)
         $value = (float)$value;
       return $value;
-- 
GitLab