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,860
  • 3
  • 30
  • 44
chrizonline
  • 4,519
  • 15
  • 57
  • 98

2 Answers2

17

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
  • 491,798
  • 79
  • 706
  • 853
0

Use "urldecode"

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