Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Issue fix #847 #857

Merged
merged 1 commit into from
Apr 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/core/Directus/Util/StringUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ public static function replacePlaceholder($string, $data = [], $placeHolderForma
}
}

/**
* If any variable of the given string have null value as a replacement then the
* result will be 'null'(string). So we need to replace it with blank string.
*/
$string = str_replace("'null'", "''", $string);

// convert all remaining optionals placeholder from {{optional(key)}} to // 'key' => ''
$pattern = '#^(.*)({{optional\((.*)\)}})(.*\n)?#im';
$string = preg_replace_callback($pattern, function ($matches) use ($keyName) {
Expand Down