Fix infinite loop using postgres as backend
unescapebin is handed a string in some cases, and it causes an infinite loop when it does. This ensures that the argument is a resource before loading its contents.
unescapebin is handed a string in some cases, and it causes an infinite loop when it does. This ensures that the argument is a resource before loading its contents.