This error can happen if you are testing the publish.php page (pixel upload) and you have 'Validate URLs' feature turned on in Main Config.
The reason is that you have entered an invalid URL which PHP cannot verify.
1. Correct the URL
2. Turn off automatic URL validation in Main Config.