Loading nixos/modules/services/web-apps/wordpress.nix +6 −3 Original line number Diff line number Diff line Loading @@ -75,13 +75,16 @@ let mkPhpValue = v: let isHasAttr = s: isAttrs v && hasAttr s v; # "you're escaped" -> "'you\'re escaped'" # https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.single toPhpString = s: "'${escape [ "'" "\\" ] s}'"; in if isString v then escapeShellArg v if isString v then toPhpString v # NOTE: If any value contains a , (comma) this will not get escaped else if isList v && any lib.strings.isCoercibleToString v then escapeShellArg (concatMapStringsSep "," toString v) else if isList v && any lib.strings.isCoercibleToString v then toPhpString (concatMapStringsSep "," toString v) else if isInt v then toString v else if isBool v then boolToString v else if isHasAttr "_file" then "trim(file_get_contents(${lib.escapeShellArg v._file}))" else if isHasAttr "_file" then "trim(file_get_contents(${toPhpString v._file}))" else if isHasAttr "_raw" then v._raw else abort "The Wordpress config value ${lib.generators.toPretty {} v} can not be encoded." ; Loading nixos/tests/wordpress.nix +2 −2 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ rec { }; nodes = lib.foldl (a: version: let package = pkgs."wordpress${version}"; package = pkgs."wordpress_${version}"; in a // { "wp${version}_httpd" = _: { services.httpd.adminAddr = "webmaster@site.local"; Loading Loading @@ -67,7 +67,7 @@ rec { networking.hosts."127.0.0.1" = [ "site1.local" "site2.local" ]; }; }) {} [ "6_3" "6_4" "6_5" "6_6" ]; testScript = '' Loading pkgs/servers/web-apps/wordpress/default.nix +2 −2 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ hash = "sha256-bIRmTqmzIRo1KdhAcJa1GxhVcTEiEaLFPzlNFbzfLcQ="; }; wordpress_6_6 = { version = "6.6.1"; hash = "sha256-YW6BhlP48okxLrpsJwPgynSHpbdRqyMoXaq9IBd8TlU="; version = "6.6.2"; hash = "sha256-JpemjLPc9IP0/OiASSVpjHRmQBs2n8Mt4nB6WcTCB9Y="; }; } Loading
nixos/modules/services/web-apps/wordpress.nix +6 −3 Original line number Diff line number Diff line Loading @@ -75,13 +75,16 @@ let mkPhpValue = v: let isHasAttr = s: isAttrs v && hasAttr s v; # "you're escaped" -> "'you\'re escaped'" # https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.single toPhpString = s: "'${escape [ "'" "\\" ] s}'"; in if isString v then escapeShellArg v if isString v then toPhpString v # NOTE: If any value contains a , (comma) this will not get escaped else if isList v && any lib.strings.isCoercibleToString v then escapeShellArg (concatMapStringsSep "," toString v) else if isList v && any lib.strings.isCoercibleToString v then toPhpString (concatMapStringsSep "," toString v) else if isInt v then toString v else if isBool v then boolToString v else if isHasAttr "_file" then "trim(file_get_contents(${lib.escapeShellArg v._file}))" else if isHasAttr "_file" then "trim(file_get_contents(${toPhpString v._file}))" else if isHasAttr "_raw" then v._raw else abort "The Wordpress config value ${lib.generators.toPretty {} v} can not be encoded." ; Loading
nixos/tests/wordpress.nix +2 −2 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ rec { }; nodes = lib.foldl (a: version: let package = pkgs."wordpress${version}"; package = pkgs."wordpress_${version}"; in a // { "wp${version}_httpd" = _: { services.httpd.adminAddr = "webmaster@site.local"; Loading Loading @@ -67,7 +67,7 @@ rec { networking.hosts."127.0.0.1" = [ "site1.local" "site2.local" ]; }; }) {} [ "6_3" "6_4" "6_5" "6_6" ]; testScript = '' Loading
pkgs/servers/web-apps/wordpress/default.nix +2 −2 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ hash = "sha256-bIRmTqmzIRo1KdhAcJa1GxhVcTEiEaLFPzlNFbzfLcQ="; }; wordpress_6_6 = { version = "6.6.1"; hash = "sha256-YW6BhlP48okxLrpsJwPgynSHpbdRqyMoXaq9IBd8TlU="; version = "6.6.2"; hash = "sha256-JpemjLPc9IP0/OiASSVpjHRmQBs2n8Mt4nB6WcTCB9Y="; }; }