MDL-51435 Web Services: E_WARNING in core_webservice_get_site_info

$plugin was not being set before the version file was included.
This caused an E_WARNING: Creating default object from empty value

This change creates the plugin object before the version file sets its parameters.
This commit is contained in:
Neill Magill
2015-10-09 09:06:53 +01:00
parent 6d8dbfee53
commit c21fca27fd
+1
View File
@@ -139,6 +139,7 @@ class core_webservice_external extends external_api {
if (is_readable($versionpath)) {
// We store the component version once retrieved (so we don't load twice the version.php).
if (!isset($componentversions[$function->component])) {
$plugin = new stdClass();
include($versionpath);
$componentversions[$function->component] = $plugin->version;
$version = $plugin->version;