From 6c3cf46438ab49624004db8b614c261609328eec Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 21 Nov 2016 15:45:16 +0100 Subject: impressive-display: Validate PDF_URI before using it with curl. --- bin/impressive-display | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/impressive-display b/bin/impressive-display index f04f683..58411e7 100755 --- a/bin/impressive-display +++ b/bin/impressive-display @@ -157,6 +157,12 @@ else RESOLUTION="$DEFAULT_RESOLUTION" fi +if ! echo "$PDF_URI" | grep -E "^(file://|http://|https://).*"; then + $OUTPUT "ERROR: PDF_URI format not supported: $PDF_URI" + $OUTPUT " Use file:///.pdf(.gz) or http(s):////.pdf. Doing nothing." + exit -1 +fi + if [ -n "${RESOLUTION}" ]; then if type -p xrandr 1>/dev/null; then xrandr -d :0 --output "$(echo $currentOutput)" --mode $RESOLUTION -- cgit v1.2.3