Chris M.
Forum Replies Created
-
I’ve updated the gist to fix that bug: https://gist.github.com/1215001
Oops! It seems that in it’s current form, my code messes with all site URLs, not just the current one. Let me see if I can fix that real quick.
Hmm… here’s a gist of the plugin I’m using to test my code, since the forums don’t handle large blocks of code very well.
It’s worth noting that the second change does not fix the issue for anyone who already has a domain name in the system that’s not all lower case—it might make sense to make both changes for the time-being (both
strtolower()when inserting into the database, andstrcasecmp()when comparing the domains).That’s the issue—the domain mapping plugin doesn’t treat domains in a case insensitive way. If you look at the function
domain_mapping_siteurl()(lines 529 and 536) you can see that it simply pulls the domain from the database as is, and indm_domains_admin()it inserts the domain directly as it is sent from$_POST(lines 163 and 166). So if I enter “MyDomain.com” on the domain mapping admin page, it gets saved in the database as “MyDomain.com” — not “mydomain.com”. Finally, if you look atredirect_to_mapped_domain()(line 707), you’ll see that it simply checks if the domain in the database matches the domain in the$current_blogglobal variable.$current_blog->domainshould always be lower case, butdomain_mapping_siteurl()does not always return a lower case domain, so that check will always return false if the domain is not entered as all lower case in the admin panel.A better fix might be changing the
dm_domains_admin()function so that it performsstrtolower()on$_POST['domain']before inserting it into the database.Forum: Plugins
In reply to: Fixes to make OpenID work on PHP 5.3Yep—changing those two lines got it working for me!
Thanks!
Forum: Plugins
In reply to: Fixes to make OpenID work on PHP 5.3The file is openid/Auth/OpenID/Server.php — I haven’t tested whether those changes work yet, but that’s the file he’s referring to.
Forum: Fixing WordPress
In reply to: Redirecting URL hackThey’re fixed on my site, and I know that Google will eventually get the right links, but until that happens every visitor from a Google search is just going to get a HTTP 400 error, which is less than ideal. It seems like there must be a way to redirect those old URLs to working ones, but Apache doesn’t like them one bit.
Chris