From e3383e70ef4e127de59e22627ef8a18958f9fe45 Mon Sep 17 00:00:00 2001 From: Kelsey Sheely Date: Fri, 6 Mar 2020 10:38:07 -0700 Subject: [PATCH] Update (XmlObjectSerializer): force object to use the namespaced class when creating an object from an xml element. From issue https://github.com/intuit/QuickBooks-V3-PHP-SDK/issues/274. This ensures that conflicting libraries do not accidentally get loaded before the libraries from this SDK --- src/Core/Http/Serialization/XmlObjectSerializer.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Core/Http/Serialization/XmlObjectSerializer.php b/src/Core/Http/Serialization/XmlObjectSerializer.php index 1c7d8658..65b717e0 100644 --- a/src/Core/Http/Serialization/XmlObjectSerializer.php +++ b/src/Core/Http/Serialization/XmlObjectSerializer.php @@ -83,9 +83,7 @@ public static function getPostXmlFromArbitraryEntity($entity, &$urlResource) private static function PhpObjFromXml($className, $xmlStr) { $className = trim($className); - if (class_exists($className, CoreConstants::USE_AUTOLOADER)) { - $phpObj = new $className; - } elseif (class_exists(CoreConstants::NAMEPSACE_DATA_PREFIX . $className, CoreConstants::USE_AUTOLOADER)) { + if (class_exists(CoreConstants::NAMEPSACE_DATA_PREFIX . $className, CoreConstants::USE_AUTOLOADER)) { $className = CoreConstants::NAMEPSACE_DATA_PREFIX . $className; $phpObj = new $className; } else {