CRM_Core_Menu - Fix warnings during local test run (dev/core#742)
[civicrm-core.git] / CRM / Core / Menu.php
index 632d9eea6186b29e48d89df55bbc9af5747af219..f370b8cacb6b16e642f31bb5639fa8d68f7b2add 100644 (file)
@@ -96,7 +96,7 @@ class CRM_Core_Menu {
    * @throws Exception
    */
   public static function read($name, &$menu) {
-    $xml = simplexml_load_file($name);
+    $xml = simplexml_load_string(file_get_contents($name));
     self::readXML($xml, $menu);
   }
 
@@ -593,13 +593,13 @@ UNION (
       // Move module_data into main item.
       if (isset(self::$_menuCache[$menu->path]['module_data'])) {
         CRM_Utils_Array::extend(self::$_menuCache[$menu->path],
-          unserialize(self::$_menuCache[$menu->path]['module_data']));
+          CRM_Utils_String::unserialize(self::$_menuCache[$menu->path]['module_data']));
         unset(self::$_menuCache[$menu->path]['module_data']);
       }
 
       // Unserialize other elements.
       foreach (self::$_serializedElements as $element) {
-        self::$_menuCache[$menu->path][$element] = unserialize($menu->$element);
+        self::$_menuCache[$menu->path][$element] = CRM_Utils_String::unserialize($menu->$element);
 
         if (strpos($path, $menu->path) !== FALSE) {
           $menuPath = &self::$_menuCache[$menu->path];