]> bicyclesonthemoon.info Git - botm/common-perl/commitdiff
allow query as hash ref in merge_url()
authorb <rowerynaksiezycu@gmail.com>
Mon, 9 Oct 2023 22:03:29 +0000 (22:03 +0000)
committerb <rowerynaksiezycu@gmail.com>
Mon, 9 Oct 2023 22:03:29 +0000 (22:03 +0000)
botm_common.pm

index 69d6cd93b37a0889fe2e9718ec954dc5581b04c7..1de622e5a1e9032d2fd61aae7ad46548edf5c5e6 100644 (file)
@@ -25,7 +25,7 @@ use Encode ('encode', 'decode');
 
 use Exporter;
 
-our $VERSION     = '1.0.23';
+our $VERSION     = '1.0.24';
 our @ISA         = qw(Exporter);
 our @EXPORT      = ();
 our @EXPORT_OK   = (
@@ -880,6 +880,9 @@ sub merge_url {
                        if ($target_data{'append_query'}) {
                                $final_data{'query'} = merge_url_query($target_data{'encoding'}, $final_data{'query'}, $target_data{'query'});
                        }
+                       elsif (ref($target_data{'query'})) {
+                               $final_data{'query'} = url_query_encode($target_data{'query'}, $target_data{'encoding'});
+                       }
                        else {
                                $final_data{'query'} = $target_data{'query'};
                        }