Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
binal-7span authored and Lapsus committed May 8, 2019
1 parent ec19d63 commit 757eabe
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit 757eabe

Please sign in to comment.