diff --git a/gitlab/functions.sh b/gitlab/functions.sh
index 8c9e462658d8f1a18ddd494bbc68ac12e1e8ecf5..c907e01ecd0ee498edf86974f6dd06e6359a1799 100644
--- a/gitlab/functions.sh
+++ b/gitlab/functions.sh
@@ -242,7 +242,7 @@ dav_recursive_mkdir() {
   local current_subpath=''
 
   # loop through segments
-  for seg in $path_segments; do
+  for seg in "${path_segments[@]}"; do
     # append each segment to the current subpath
     current_subpath="${current_subpath}${seg}/"
     log_info "mkdir $DOCSERVER/$current_subpath"