Author Topic: Handling URL with spaces in the field "MediaURL"  (Read 1419 times)

nikov

  • Newbie
  • Posts: 2
Handling URL with spaces in the field "MediaURL"
« on: September 07, 2011, 02:17:11 pm »
Hello.
Just a small correction that takes me quite à long time to find...

- convert " " in "%20" in URL when you editors don't want ta take care of it :
In file "powerpressadmin.php, line 955 :

Code: [Select]
$MediaURL = $Powerpress['url'];
$MediaURL = str_replace(" ", "%20", $MediaURL );

Bonjour de France !

mgdell

  • Blubrry Customer Support Coordinator
  • Administrator
  • Hero Member
  • *****
  • Posts: 3318
Re: Handling URL with spaces in the field "MediaURL"
« Reply #1 on: September 09, 2011, 09:12:25 am »
nikov,

You shouldn't really use media URL's with spaces in them.  Not all players / software can handle them correctly.

-Mike


angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Handling URL with spaces in the field "MediaURL"
« Reply #2 on: September 09, 2011, 09:46:34 am »
To elaborate with what Mike is saying, adding the %20 may work for your download links, but they then can cause issues for Javascript/flash based players. I'll look at adding this logic, but last time we tested doing this it broke both Flash and some JavaScript players on a variety of podcast directory web sites (places where you submit your podcast feed and then they display their own player to play your media file) as well as some podcatchers (none of the popular ones had issues).

We display a warning when you post a media URL with spaces. We do this for your benefit. Obviously if you love to have spaces in your file names you can do what ever you want, but based on our experience replacing the spaces with a character such as _ or - gives you that assurance that your media isn't going to have a problem playing anywhere.

nikov

  • Newbie
  • Posts: 2
Re: Handling URL with spaces in the field "MediaURL"
« Reply #3 on: September 17, 2011, 05:25:51 am »
Hello,
I know of course that spaces in URL is a bad thing, but not all of my contributors know it...
I don't know how Flash or Javascript hadle these links, but with a real podcast software (It****), it seems to work.
I just posted this trick because everything is not perfect in a perfect world. I also don't have the authority to rename files on the podcast server, it's just a  quick patch for those who are in the same situation.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Handling URL with spaces in the field "MediaURL"
« Reply #4 on: September 19, 2011, 10:53:44 am »
No worries, just explaining why we print the warning.  I don't want to name web sites that don't handle the URLS correctly (few popular sites that have this problem), but the old Juice (iPodder Lemon) app had issues with spaces in the file names.