I'm not sure precisely what's happening in -filenameForURLString:, but the handling of the port number substring is broken. The existing regex is invalid (there are two repetition specifiers, when only one is permitted). But when I fixed it (removing the "?"), it caused the hostname and the first element of the path to squeeze together.
Simply ripping out the port is probably a bad idea. It might be better to replace the colon with an underscore. I'm going to try that myself.
I'm not sure precisely what's happening in -filenameForURLString:, but the handling of the port number substring is broken. The existing regex is invalid (there are two repetition specifiers, when only one is permitted). But when I fixed it (removing the "?"), it caused the hostname and the first element of the path to squeeze together.
Simply ripping out the port is probably a bad idea. It might be better to replace the colon with an underscore. I'm going to try that myself.