[pve-devel] applied: [PATCH common] tools: template_replace: esacpe braces

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Nov 19 10:07:01 CET 2018


applied

On Sun, Nov 18, 2018 at 04:06:19PM +0100, Thomas Lamprecht wrote:
> To avoid warnings (and in the future, errors) like:
> 
> > Unescaped left brace in regex is deprecated here (and will be fatal
> > in Perl 5.32), passed through in regex; marked by <-- HERE in
> > m/([^{]+)?({ <-- HERE ([^}]+)})?/ at /usr/share/perl5/PVE/Tools.pm
> > line 673.
> 
> with future perl versions, like Debian Buster for example has.
> 
> Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
> ---
>  src/PVE/Tools.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
> index 6254b2e..0f31fdb 100644
> --- a/src/PVE/Tools.pm
> +++ b/src/PVE/Tools.pm
> @@ -670,7 +670,7 @@ sub template_replace {
>      return $tmpl if !$tmpl;
>  
>      my $res = '';
> -    while ($tmpl =~ m/([^{]+)?({([^}]+)})?/g) {
> +    while ($tmpl =~ m/([^{]+)?(\{([^}]+)\})?/g) {
>  	$res .= $1 if $1;
>  	$res .= ($data->{$3} || '-') if $2;
>      }
> -- 
> 2.19.1




More information about the pve-devel mailing list