BOONEX.COM BOONEX BLOG BOONEX DEVZONE



Unity broken?

I cannot seem to login to Unity, and it seems due to a remote javascript that is not loading properly due to PHP errors ( http://www.boonex.com/unity/js_loader.php5 ). Since this script is trying to gzip the javascript but throwing PHP errors, the browser can’t load the remote javascript. Same thing happens when searching the forums on expertzz.com ( http://www.expertzzz.com/forumz/js/loader.php ), so I imagine that any portion of either site that uses this method to deliver remote Javascripts may possibly be affected. I know that this is a not a support blog, but since this is affecting my ability to complete an installation of a registered Dolphin / Ray setup, I am posting anyways, as I have emailed both support@boonex.com and bug_reports@boonex.com from the BoonEx contact page, but so far I have heard nothing, and am hoping I don’t have to wait until Monday for this to be addressed. Thanks.

5 Responses to “Unity broken?”


  1. 1 Victor T.

    @subzero2000

    We will check this out in all browsers available and let you know.
    BTW what browser have you used? Have you tried to login using an alternative one?

  2. 2 subzero2000

    http://www.boonex.com/unity/js_loader.php5 has the following PHP errors at the top of it:

    Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/boonex/public_html/unity/system/classes/BxJsGzipLoader.php5 on line 104

    Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/boonex/public_html/unity/system/classes/BxJsGzipLoader.php5 on line 104

    Warning: Cannot modify header information - headers already sent by (output started at /home/boonex/public_html/unity/system/classes/BxJsGzipLoader.php5:104) in /home/boonex/public_html/unity/system/classes/BxJsGzipLoader.php5 on line 187

    http://www.expertzzz.com/forumz/js/loader.php has the following PHP errors at the top of it:

    Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/zzz/public_html/forumz/classes/BxJsGzipLoader.php on line 104

    Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/zzz/public_html/forumz/classes/BxJsGzipLoader.php on line 104

    Warning: Cannot modify header information - headers already sent by (output started at /home/zzz/public_html/forumz/classes/BxJsGzipLoader.php:104) in /home/zzz/public_html/forumz/classes/BxJsGzipLoader.php on line 187

    However, a friend of mine using same browser but different IP address can access it without problem, so it does not appear to be affecting everyone. I would suspect differences based on IP address or cookie, as every browser on every computer at my IP suffers from this problem. Thanks.

  3. 3 subzero2000

    I think I’ve found the problem, and it appears to be a bug in orca/classes/BxJsGzipLoader.php

    The function check encoding looks like this:

    /**
    * check if client browser supports gzip
    */
    function checkEncoding ()
    {
    if (isset($_SERVER[’HTTP_ACCEPT_ENCODING’]))
    $encodings = explode(’,', strtolower(preg_replace(”/\s /”, “”, $_SERVER[’HTTP_ACCEPT_ENCODING’])));

    if ((in_array(’gzip’, $encodings) || in_array(’x-gzip’, $encodings) || isset($_SERVER[’—————’])) && function_exists(’ob_gzhandler’) && !ini_get(’zlib.output_compression’))
    {
    $this->_sEnc = in_array(’x-gzip’, $encodings) ? “x-gzip” : “gzip”;
    $this->_bGzip = true;
    }
    }

    I had set an empty string for encodings in Firefox so as to not receive gzip encoding for debugging purposes, which caused Firefox not to send an encoding header, which means that $_SERVER[’HTTP_ACCEPT_ENCODING’]was not set. If it is not set, $encodings is never initialized prior to being referenced in the in_array function (I noticed this error in my server logs, which is what clued me into the fact that I had the same block of code on my server that was causing me problems). I would open a ticket for Orca in the Trac system, but I apparently don’t have an account. The fix is simple; here is the revised function:

    /**
    * check if client browser supports gzip
    */
    function checkEncoding ()
    {
    $encodings = array();
    if (isset($_SERVER[’HTTP_ACCEPT_ENCODING’]))
    $encodings = explode(’,', strtolower(preg_replace(”/\s /”, “”, $_SERVER[’HTTP_ACCEPT_ENCODING’])));

    if ((in_array(’gzip’, $encodings) || in_array(’x-gzip’, $encodings) || isset($_SERVER[’—————’])) && function_exists(’ob_gzhandler’) && !ini_get(’zlib.output_compression’))
    {
    $this->_sEnc = in_array(’x-gzip’, $encodings) ? “x-gzip” : “gzip”;
    $this->_bGzip = true;
    }
    }

  4. 4 Victor T.

    Thanks for the details. Added to Dev Zone to be fixed.

  5. 5 subzero2000

    I’ve discovered that there is a good possibility that setting display_errors to Off would address issues like this to keep the PHP notices and warnings from being output. However, it would be best to debug with display_settings to On so that error messages can be tracked down and fixed, as it is recommended to set display_settings to Off in a production environment.

Leave a Reply

You must login to post a comment.