diff --git a/libs/FML/Script/Builder.php b/libs/FML/Script/Builder.php index 4fe2a248..62b9b561 100644 --- a/libs/FML/Script/Builder.php +++ b/libs/FML/Script/Builder.php @@ -49,6 +49,10 @@ abstract class Builder */ public static function escapeText($text = "", $addApostrophes = true) { + if ($text === null) { + if ($addApostrophes) return "\"\""; + return ""; + } $dangers = array('\\', '"', "\n"); $replacements = array('\\\\', '\\"', '\\n'); $escapedText = str_ireplace($dangers, $replacements, $text);