Skip to content

Commit

Permalink
Do not sanitize 'location' if it's regex
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkenn4545 authored Jan 25, 2017
1 parent ad35502 commit 87aafd7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions manifests/resource/location.pp
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,12 @@

$config_file = "${server_dir}/${server_sanitized}.conf"

$location_sanitized_tmp = regsubst($location, '\/', '_', 'G')
$location_sanitized = regsubst($location_sanitized_tmp, '\\\\', '_', 'G')
if !($location =~ /^~/) {
$location_sanitized_tmp = regsubst($location, '\/', '_', 'G')
$location_sanitized = regsubst($location_sanitized_tmp, '\\\\', '_', 'G')
} else {
$location_sanitized = $location_sanitized_tmp
}

if $ensure == present and $fastcgi != undef and !defined(File[$fastcgi_params]) {
file { $fastcgi_params:
Expand Down

0 comments on commit 87aafd7

Please sign in to comment.