5

i have a page with links gotten from rss. they are: broken link

http://news.asiaone.com/News/Latest%252BNews/Singapore/Story/A1Story20121220-390687.html

working link

http://news.asiaone.com/News/Latest%2BNews/Singapore/Story/A1Story20121220-390687.html

i realise it works by changing %252B to %2B. im using php. is there a way to detect and correct it on the run?

PhearOfRayne
  • 4,990
  • 3
  • 31
  • 44
chrizonline
  • 4,779
  • 17
  • 62
  • 102

2 Answers2

18

The URL has been double encoded. %25 is the escape sequence for "%", so a regular %2B got escaped again to %252B.

urldecode the value, but better avoid double-encoding it to begin with if possible.

deceze
  • 510,633
  • 85
  • 743
  • 889
0

Use "urldecode"

echo urldecode("http://news.asiaone.com/News/Latest%252BNews/Singapore/Story/A1Story20121220-390687.html");
sk8terboi87 ツ
  • 3,396
  • 3
  • 34
  • 45