? Success

User tests: Successful: Unsuccessful:

avatar zero-24
zero-24
8 Aug 2014

Why we need this spezial test?

In some envoirments ini_get('xcache.admin.enable_auth') is off but return empty.

Tracker

http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_id=8103&tracker_item_id=34044

avatar zero-24 zero-24 - open - 8 Aug 2014
avatar jissues-bot jissues-bot - change - 8 Aug 2014
Title
xcache not working under J3.3.3
[#34044] xcache not working under J3.3.3
Labels Added: ? ?
avatar Bakual
Bakual - comment - 8 Aug 2014

What exactly is returned by ini_get in that case? An empty string or null?
Because looking at the existing checks and its comments it seems to be important to not use a generic boolean like empty here. If you check here using empty, the previous check which explicitely checks for an integer 0 would be not needed anymore. empty will return true for a boolean false, an integer 0, an empty string or a string containing 0 and for null.

avatar zero-24
zero-24 - comment - 8 Aug 2014

What exactly is returned by ini_get in that case? An empty string or null?

Can you answer here @anibalsanchez ?

I only create the patch based on the comment by @anibalsanchez on the JC Tracker.

Same issue here!
In PHP Information tab: xcache.admin.enable_auth=Off
ini_get('xcache.admin.enable_auth') is empty
Confirmed in PHP 5.5.3 and 5.3.10.

Quick fix, xcache.php, line 238, return true; ... or check for empty $xcache_admin_enable_auth a couple of lines below.

avatar anibalsanchez
anibalsanchez - comment - 8 Aug 2014
        if (extension_loaded('xcache'))
        {
            // XCache Admin must be disabled for Joomla to use XCache
            $xcache_admin_enable_auth = ini_get('xcache.admin.enable_auth');

isset($xcache_admin_enable_auth) => true
empty($xcache_admin_enable_auth) => true
is_null($xcache_admin_enable_auth) => false
avatar anibalsanchez
anibalsanchez - comment - 8 Aug 2014
($xcache_admin_enable_auth === '0') => false
($xcache_admin_enable_auth == '0') => false
($xcache_admin_enable_auth === '') => true
($xcache_admin_enable_auth == '') => true
avatar anibalsanchez
anibalsanchez - comment - 8 Aug 2014

@test Patch works Ok! Txs!

avatar Bakual
Bakual - comment - 8 Aug 2014

($xcache_admin_enable_auth === '') => true

Looks like it's an empty string then. I'd suggest to use this as the check instead of empty which may be to generic.

avatar zero-24
zero-24 - comment - 9 Aug 2014
avatar Bakual
Bakual - comment - 9 Aug 2014

Looks good to me. @anibalsanchez can you please test this latest version again?

avatar anibalsanchez
anibalsanchez - comment - 9 Aug 2014

It works perfect! I've already deployed to it several sites.

avatar Bakual Bakual - change - 9 Aug 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-08-09 18:16:02
avatar Bakual Bakual - close - 9 Aug 2014
avatar zero-24
zero-24 - comment - 9 Aug 2014

thanks @anibalsanchez and @Bakual

Add a Comment

Login with GitHub to post a comment