View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
04372Bug reportsInstallationpublic2010-06-08 21:51
Reporteruser8307Assigned Totexens  
PrioritynormalSeverityblock 
Status closedResolutionfixed 
Product Version1.90b 
Summary04372: After running install script, loading the admin page crashes blank
Description

Webserver error log:
PHP Fatal error: Cannot redeclare json_decode() (previously declared in /var/www/html/survey/classes/core/startup.php:70) in /var/www/html/survey/classes/core/startup.php on line 83

Steps To Reproduce

system running php version older then 5.2

Additional Information

Looks like a typo on the json_encode function. The if statement is right, but the define is json_decode changing it to json_encode and it works fine.

Code in question from startup.php:

/**

  • This function converts a standard # array to a PHP array without having to resort to JSON_decode which is available from 5.2x and up only
  • @param string $json String with JSON data
  • @return array
    */
    if ( !function_exists('json_decode') ){
    function json_decode($content, $assoc=false){
    global $homedir;
    require_once($homedir."/classes/json/JSON.php");
    if ( $assoc ){
    $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
    } else {
    $json = new Services_JSON;
    }
    return $json->decode($content);
    }
    }

if ( !function_exists('json_encode') ){
function json_decode($content){
global $homedir;
require_once($homedir."/classes/json/JSON.php");
$json = new Services_JSON;
return $json->encode($content);
}
}

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)8745
I will donate to the project if issue is resolved
BrowserFirefox 3.6.3
Database type & versionmsyql 5.0.77
Server OS (if known)RHEL 5.4 x86_32
Webserver software & version (if known)apache 2.2.3
PHP Version5.1.6

Users monitoring this issue

There are no users monitoring this issue.

Activities

Mazi

Mazi

2010-05-27 18:05

updater   ~12012

Machaven, is this just a simple typo?

machaven

machaven

2010-05-27 19:07

reporter   ~12013

i'm not familiar with JSON, maybe someone else can give some input or i can investigate?

Mazi

Mazi

2010-05-27 23:32

updater   ~12015

texens, you just worked with JSON, maybe you can help?!

texens

texens

2010-05-28 02:18

reporter   ~12018

Fixed in r8758.

It was indeed, just a simple typo in the function declaration.

Issue History

Date Modified Username Field Change
2010-05-27 17:05 user8307 New Issue
2010-05-27 17:05 user8307 Status new => assigned
2010-05-27 17:05 user8307 Assigned To => user372
2010-05-27 18:05 Mazi Assigned To user372 => machaven
2010-05-27 18:05 Mazi Note Added: 12012
2010-05-27 19:07 machaven Note Added: 12013
2010-05-27 23:31 Mazi Assigned To machaven => texens
2010-05-27 23:32 Mazi Note Added: 12015
2010-05-28 02:18 texens Note Added: 12018
2010-05-28 02:18 texens Status assigned => resolved
2010-05-28 02:18 texens Resolution open => fixed
2010-06-08 21:51 c_schmitz Status resolved => closed