Commit 10dc92d0 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1642745: Fix error Only variables should be passed by reference"

parents c456251e ec7dde1c
......@@ -461,7 +461,8 @@ class LeapImportFile extends LeapImportArtefactPlugin {
else {
$usr = $importer->get('usrobj');
}
$data->oldextension = end(explode('.', $data->title));
$title_explode = explode('.', $data->title);
$data->oldextension = end($title_explode);
// This API sucks, but that's not my problem
if (!$id = ArtefactTypeFile::save_file($data->pathname, $data, $usr, true)) {
$importer->trace("WARNING: the file for entry $entryid does not exist in the import (path={$data->pathname})");
......
......@@ -53,7 +53,8 @@ foreach (array('soap', 'xmlrpc', 'rest') as $proto) {
$popts[$proto] = get_string($proto, 'auth.webservice');
}
}
$default_protocol = (empty($protocol) ? array_shift(array_keys($popts)) : $protocol);
$popts_keys = array_keys($popts);
$default_protocol = (empty($protocol) ? array_shift($popts_keys) : $protocol);
$elements['protocol'] = array(
'type' => 'select',
'title' => get_string('protocol', 'auth.webservice'),
......@@ -96,7 +97,8 @@ if (!empty($authtype)) {
$sopts[$dbservice->id] = $dbservice->name . ' (' . ($dbservice->restrictedusers ? get_string('userauth', 'auth.webservice') : get_string('tokenauth', 'auth.webservice')) . ')';
}
}
$default_service = ($service == 0 ? array_shift(array_keys($sopts)) : $service);
$sopts_keys = array_keys($sopts);
$default_service = ($service == 0 ? array_shift($sopts_keys) : $service);
$elements['service'] = array(
'type' => 'select',
'title' => get_string('servicename', 'auth.webservice'),
......@@ -115,7 +117,8 @@ if (!empty($authtype)) {
$fopts[$dbfunction->id] = $dbfunction->functionname;
}
}
$default_function = ($function == 0 ? array_shift(array_keys($fopts)) : $function);
$fopts_keys = array_keys($fopts);
$default_function = ($function == 0 ? array_shift($fopts_keys) : $function);
$elements['function'] = array(
'type' => 'select',
'title' => get_string('functions', 'auth.webservice'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment