Try to stop weird symbols from quotes crashing the bot.
This commit is contained in:
		| @@ -1,5 +1,6 @@ | ||||
| [ -f functions.sh ] && source functions.sh | ||||
|  | ||||
| set -f | ||||
| quote="$(curl -s http://bash.org/?random)" | ||||
| quote="$(echo "$quote" | grep -m 1 -A 10 '"Permanent link to this quote."')" | ||||
| quote="${quote#*class=\"qt\">}" | ||||
| @@ -7,5 +8,5 @@ quote="${quote//</<}" | ||||
| quote="${quote//>/>}" | ||||
| quote="${quote%%<p class*}" | ||||
| quote="$(echo "$quote" | pandoc -t plain)" | ||||
| msg "$2" "$(echo "$quote" | tr -s '[:space:]' ' ')" | ||||
| exit 0 | ||||
| msg "$2" "$(echo "$quote" | tr -cd '[:print:]')" | ||||
| set +f | ||||
|   | ||||
		Reference in New Issue
	
	Block a user