Fix #1448: URL detection & JFile::write() Fatal error: Cannot pass parameter 2 by reference

Fix #1448: Make automatic URL detection more conservative
Fix JFile::write() Fatal error: Cannot pass parameter 2 by reference