Commit f83f556a authored by Franco Fichtner's avatar Franco Fichtner

firmware: pass argument, why not...

parent 5daf7785
......@@ -176,15 +176,16 @@ class FirmwareController extends ApiControllerBase
return $response;
}
if (empty($version)) {
// sanitize package name
$filter = new \Phalcon\Filter();
$filter->add('version', function ($value) {
return preg_replace('/[^0-9a-zA-Z\.]/', '', $value);
});
$version = $filter->sanitize($version, 'version');
if ($version == 'update') {
$backend->configdRun('firmware changelog fetch');
} else {
// sanitize package name
$filter = new \Phalcon\Filter();
$filter->add('version', function ($value) {
return preg_replace('/[^0-9a-zA-Z\.]/', '', $value);
});
$version = $filter->sanitize($version, 'version');
$text = trim($backend->configdRun(sprintf('firmware changelog text %s', $version)));
$html = trim($backend->configdRun(sprintf('firmware changelog html %s', $version)));
if (!empty($text)) {
......
......@@ -485,7 +485,7 @@ POSSIBILITY OF SUCH DAMAGE.
$('#checkupdate_maj').click(function () {
$("#checkupdate_progress").addClass("fa fa-spinner fa-pulse");
// empty call refreshes changelogs in the background
ajaxCall('/api/core/firmware/changelog/', {}, function () {
ajaxCall('/api/core/firmware/changelog/update', {}, function () {
$("#checkupdate_progress").removeClass("fa fa-spinner fa-pulse");
BootstrapDialog.show({
type:BootstrapDialog.TYPE_WARNING,
......
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