LScli::unquote_word: Fix PHP warning

This commit is contained in:
Benjamin Renard 2024-02-19 19:58:04 +01:00
parent 15e3ffe6ef
commit e8781ab779
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC

View file

@ -819,7 +819,7 @@ class LScli extends LSlog_staticLoggerClass {
* @return string The quote character or an empty string if word if not quoted
*/
public static function unquote_word(&$word) {
if (in_array($word[0], array('"', "'"))) {
if ($word && in_array($word[0], array('"', "'"))) {
$quote_char = $word[0];
$word = substr($word, 1);
if ($word[strlen($word)-1] == $quote_char)