andrewducker: (overwhelming firepower)
[personal profile] andrewducker
I have user input for a URL field. I want them to be able to enter anything from "http://andrewducker.wordpress.com/xmlrpc.php" to "andrewducker.wordpress.com" and be able to end up at the same end point.

I've wasted a couple of hours messing around with the various constructors for URL and not got to anywhere satisfactory, should I just do string checking and construct it myself?

I should make it clear - I always want the /xmlrpc.php bit to be what's on the end of the URL, that's a Wordpress standard, so I don't need to do any complex discovery. I just need to append that if it's not there.

I was hoping that someone would have written a class that could append bits of URLs together, but the basic stuff in the built in URL class doesn't quite cut it.
This account has disabled anonymous posting.
(will be screened if not validated)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

June 2025

S M T W T F S
1 2 3 4 5 6 7
8 91011121314
15161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 10th, 2025 07:36 am
Powered by Dreamwidth Studios