[wp-testers] Akismet 1.12 on IIS

Ryan Boren ryan at boren.nu
Wed Dec 21 23:08:05 GMT 2005


On Wed, 2005-12-21 at 17:26 -0500, James Johnson wrote: 
> I see, thanks for those links.
> 
> So what is the correct usage? According mboothby in the ticket Toby linked
> to the 'old' way to add a management function is to register with
> basename(__FILE__) and the new way is just plain __FILE__.  Yet the new way
> breaks on IIS and the ticket you linked to says the opposite, the old way is
> __FILE__ and the new way should be basename(__FILE__).
> 
> Testing on my site tells me that the ticket you link to is correct; using
> basename(__FILE__) works while the existing __FILE__ does not.  But how does
> that play with other servers?


Using basename(__FILE__) can break things.  We need the whole thing so
that we can get to full path relative to the plugins directory.

Maybe some debug code would shed some light.  Could those seeing this
problem add the following somewhere in akismet.php?

echo 'FILE: ' . __FILE__ . '<br />';
echo 'basename: ' . basename(__FILE__) . '<br />';
echo 'plugin_basename: ' . plugin_basename(__FILE__) . '<br />';
echo 'base plugin base: ' . plugin_basename(basename(__FILE__)) .
'<br />';
Ryan

> -----Original Message-----
> From: wp-testers-bounces at lists.automattic.com
> [mailto:wp-testers-bounces at lists.automattic.com] On Behalf Of Owen Winkler
> Sent: Wednesday, December 21, 2005 4:30 PM
> To: wp-testers at lists.automattic.com
> Subject: Re: [wp-testers] Akismet 1.12 on IIS
> 
> James Johnson wrote:
> > Just upgraded and it appears that the fix Matt added for IIS users is 
> > no longer in 2.0.
> > 
> > Here is the original bug that was fixed:
> > http://trac.wordpress.org/ticket/1599
> > 
> > The fix is the very last thing in changeset 3025.
> 
> That fix broke the established behavior of the plugin_basename() function,
> which is to return the filename and possibly one level of directory name for
> a plugin file that is passed to it.
> 
> When you stripslash on IIS, it often removes the slash that should be there.
> 
> If a plugin has a problem with using the function, it is a plugin issue, not
> an issue with the plugin_basename() function, though it might be worthwhile
> to see if this can be accounted for in some other way.
> 
> See:
> http://trac.wordpress.org/changeset/3139
> http://trac.wordpress.org/ticket/1866




More information about the wp-testers mailing list