From 67f2a8b2a36eceafbc338cb195f6e2e1e15de722 Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Thu, 14 Oct 2021 09:12:57 +0200 Subject: [PATCH] Quote device name in xpath request Xpath requires quotes if non numeric device name (eg 894x) --- sccpManTraits/ajaxHelper.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sccpManTraits/ajaxHelper.php b/sccpManTraits/ajaxHelper.php index 496d823..c7d7e05 100644 --- a/sccpManTraits/ajaxHelper.php +++ b/sccpManTraits/ajaxHelper.php @@ -566,9 +566,8 @@ trait ajaxHelper { switch ($request['type']) { case 'firmware': $device = $request['device']; - $firmwareDir = $tftpBootXml->xpath("//Directory[@name='firmware']"); - $result = $firmwareDir[0]->xpath("//Directory[@name={$device}]"); + $result = $firmwareDir[0]->xpath("//Directory[@name='{$device}']"); $filesToGet['firmware'] = (array)$result[0]->FileName; $totalFiles += count($filesToGet['firmware']); $srcDir['firmware'] = $provisionerUrl . (string)$result[0]->DirectoryPath;