File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed
modules/services/web-apps
pkgs/servers/web-apps/wordpress Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 7575
7676 mkPhpValue = v : let
7777 isHasAttr = s : isAttrs v && hasAttr s v ;
78+ # "you're escaped" -> "'you\'re escaped'"
79+ # https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.single
80+ toPhpString = s : "'${ escape [ "'" "\\ " ] s } '" ;
7881 in
79- if isString v then escapeShellArg v
82+ if isString v then toPhpString v
8083 # NOTE: If any value contains a , (comma) this will not get escaped
81- else if isList v && any lib . strings . isCoercibleToString v then escapeShellArg ( concatMapStringsSep "," toString v )
84+ else if isList v && any lib . strings . isCoercibleToString v then toPhpString ( concatMapStringsSep "," toString v )
8285 else if isInt v then toString v
8386 else if isBool v then boolToString v
84- else if isHasAttr "_file" then "trim(file_get_contents(${ lib . escapeShellArg v . _file } ))"
87+ else if isHasAttr "_file" then "trim(file_get_contents(${ toPhpString v . _file } ))"
8588 else if isHasAttr "_raw" then v . _raw
8689 else abort "The Wordpress config value ${ lib . generators . toPretty { } v } can not be encoded."
8790 ;
Original file line number Diff line number Diff line change 1111 } ;
1212
1313 nodes = lib . foldl ( a : version : let
14- package = pkgs . "wordpress ${ version } " ;
14+ package = pkgs . "wordpress_ ${ version } " ;
1515 in a // {
1616 "wp${ version } _httpd" = _ : {
1717 services . httpd . adminAddr = "[email protected] " ; 6767 networking . hosts . "127.0.0.1" = [ "site1.local" "site2.local" ] ;
6868 } ;
6969 } ) { } [
70- "6_3 " "6_4 "
70+ "6_5 " "6_6 "
7171 ] ;
7272
7373 testScript = ''
Original file line number Diff line number Diff line change 55 hash = "sha256-bIRmTqmzIRo1KdhAcJa1GxhVcTEiEaLFPzlNFbzfLcQ=" ;
66 } ;
77 wordpress_6_6 = {
8- version = "6.6.1 " ;
9- hash = "sha256-YW6BhlP48okxLrpsJwPgynSHpbdRqyMoXaq9IBd8TlU =" ;
8+ version = "6.6.2 " ;
9+ hash = "sha256-JpemjLPc9IP0/OiASSVpjHRmQBs2n8Mt4nB6WcTCB9Y =" ;
1010 } ;
1111}
You can’t perform that action at this time.
0 commit comments