From 33fff03fb7fc1a918776fdd9947875dc374a9be5 Mon Sep 17 00:00:00 2001
From: Thomas Schneider <thomas@fsmpi.rwth-aachen.de>
Date: Fri, 20 Mar 2020 16:03:40 +0100
Subject: [PATCH] dokuwiki: Sanitise update.sh

---
 dokuwiki/templates/update.sh.j2 | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/dokuwiki/templates/update.sh.j2 b/dokuwiki/templates/update.sh.j2
index 033b79e..f0844a3 100644
--- a/dokuwiki/templates/update.sh.j2
+++ b/dokuwiki/templates/update.sh.j2
@@ -1,10 +1,5 @@
 #!/bin/sh
 
-cwd=$PWD
-
 {% for dw in dokuwiki %}
-cd {{ dw.path }}
-curl -s https://update.dokuwiki.org/check/$(grep updateVersion doku.php | sed -E 's/\$updateVersion = "(.*)";/\1/g')
+curl -s https://update.dokuwiki.org/check/"$(sed -n -E '/updateVersion/ { s/\$updateVersion = "(.*)";/\1/g; p; q }' "{{ dw.path }}"/doku.php)"
 {% endfor %}
-
-cd ${cwd}
-- 
GitLab