Skip to content

Commit

Permalink
New Feature : PHP8.2 available version (At your own risk)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Jul 4, 2024
1 parent d573847 commit a9aea76
Show file tree
Hide file tree
Showing 1,093 changed files with 210,708 additions and 1,317 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Limesurvey is the number one open-source survey software.
Advanced features like branching and multiple question types make it a valuable partner for survey-creation.

**This is an unoffical fork of LimeSurvey, use at your own risk**
**This branch is to get a PHP8.2 compatibel version, use at your own risk**

## How to install

Expand All @@ -24,7 +25,7 @@ The absolute minimal requirements are:
### Recommended
We recommend the following setup
- Web server: nginx (most recent stable version)
- PHP <= 8.0 (For php up to 8.0: debug mode muts not be activated. Bugs with php higher than 8.0 will not be fixed. Only pull request bugs will be taken into account.)
- PHP >= 7.4
- with php-fpm, mbstring, gd2 with freetype, imap, ldap, zip, zlib and database drivers
- MariaDB or MySQL (most recent stable version)

Expand Down
4 changes: 2 additions & 2 deletions application/config/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
* See COPYRIGHT.php for copyright notices and details.
*/

$config['versionnumber'] = '5.6.71 (SondagesPro)';
$config['versionnumber'] = '5.6.71';
$config['dbversionnumber'] = 499;
$config['buildnumber'] = '';
$config['buildnumber'] = 'SondagesPro-1';
$config['updatable'] = false;
$config['templateapiversion'] = 3;
$config['assetsversionnumber'] = '30383';
Expand Down
4 changes: 2 additions & 2 deletions application/controllers/SurveyAdministrationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2828,15 +2828,15 @@ private function surveysummary(&$aData)
}

$dateformatdetails = getDateFormatData(Yii::app()->session['dateformat']);
if (trim($oSurvey->startdate) != '') {
if ($oSurvey->startdate) {
Yii::import('application.libraries.Date_Time_Converter');
$datetimeobj = new Date_Time_Converter($oSurvey->startdate, 'Y-m-d H:i:s');
$aData['startdate'] = $datetimeobj->convert($dateformatdetails['phpdate'] . ' H:i');
} else {
$aData['startdate'] = "-";
}

if (trim($oSurvey->expires) != '') {
if ($oSurvey->expires) {
Yii::import('application.libraries.Date_Time_Converter');
$datetimeobj = new Date_Time_Converter($oSurvey->expires, 'Y-m-d H:i:s');
$aData['expdate'] = $datetimeobj->convert($dateformatdetails['phpdate'] . ' H:i');
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/survey/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function action()
}

/* Get client token by POST or GET value */
$clienttoken = trim($param['token']);
$clienttoken = trim(strval($param['token']));
/* If not set : get by SESSION to avoid multiple submit of same token in different navigator */
if (empty($clienttoken) && !empty($_SESSION['survey_' . $surveyid]['token'])) {
$clienttoken = $_SESSION['survey_' . $surveyid]['token'];
Expand Down
3 changes: 3 additions & 0 deletions application/core/LS_Twig_Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ public static function registerScript($id, $script, $position = null, array $htm
*/
public static function json_decode($json, $assoc = true)
{
if (empty($json)) {
return [];
}
return (array) json_decode($json, $assoc);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function render($sCoreClasses = '')
$extraclass .= " ls-input-sized";
}

if (trim($this->getQuestionAttribute('placeholder', $this->sLanguage)) != '') {
if (!empty($this->getQuestionAttribute('placeholder', $this->sLanguage)) && trim($this->getQuestionAttribute('placeholder', $this->sLanguage)) != '') {
$placeholder = $this->getQuestionAttribute('placeholder', $this->sLanguage);
}

Expand Down
3 changes: 3 additions & 0 deletions application/helpers/SurveyRuntimeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ class SurveyRuntimeHelper
private $groupname;
private $groupdescription;

// Extra
private $thissurvey;

/**
* Main function
*
Expand Down
4 changes: 2 additions & 2 deletions application/helpers/common_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4742,7 +4742,7 @@ function getMaximumFileUploadSize()
*/
function decodeTokenAttributes($oTokenAttributeData)
{
if (trim($oTokenAttributeData) == '') {
if (empty($oTokenAttributeData) || trim($oTokenAttributeData) == '') {
return array();
}
if (substr($oTokenAttributeData, 0, 1) != '{' && substr($oTokenAttributeData, 0, 1) != '[') {
Expand Down Expand Up @@ -5084,4 +5084,4 @@ function isAbsolutePath($path)
// Relative path
return false;
}
}
}
4 changes: 2 additions & 2 deletions application/helpers/expressions/em_manager_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3405,8 +3405,8 @@ public function setVariableAndTokenMappingsForExpressionManager($surveyid, $forc
$grelevance = (isset($fielddata['grelevance'])) ? trim($fielddata['grelevance']) : 1;
$hidden = (isset($qattr[$questionNum]['hidden'])) ? ($qattr[$questionNum]['hidden'] == '1') : false;
$scale_id = (isset($fielddata['scale_id'])) ? $fielddata['scale_id'] : '0';
$preg = (isset($fielddata['preg'])) ? $fielddata['preg'] : null; // a perl regular exrpession validation function
$defaultValue = (isset($fielddata['defaultvalue']) ? $fielddata['defaultvalue'] : null);
$preg = (!empty($fielddata['preg'])) ? $fielddata['preg'] : ''; // a perl regular exrpession validation function
$defaultValue = (!empty($fielddata['defaultvalue']) ? $fielddata['defaultvalue'] : '');
if (trim($preg) == '') {
$preg = null;
}
Expand Down
2 changes: 1 addition & 1 deletion application/libraries/PluginManager/Storage/DbStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct()
*/
public function get(iPlugin $plugin, $key = null, $model = null, $id = null, $default = null, $language = null)
{
$functionName = 'get' . ucfirst($model);
$functionName = 'get' . ucfirst(strval($model));
if ($model == null || !method_exists($this, $functionName)) {
return $this->getGeneric($plugin, $key, $model, $id, $default);
} else {
Expand Down
15 changes: 9 additions & 6 deletions application/models/SurveymenuEntryData.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ public function apply($menuEntry, $surveyid = null)
{
$this->surveyid = $surveyid;
$this->menuEntry = $menuEntry;

$oData = json_decode(stripcslashes($this->menuEntry->data));
$jsonError = json_last_error();
if ($jsonError) {
if (is_null($this->menuEntry->data)) {
$this->rawData = [];
} else {
$this->rawData = $oData;
$this->parseDataAttribute();
$oData = json_decode(stripcslashes($this->menuEntry->data));
$jsonError = json_last_error();
if ($jsonError) {
$this->rawData = [];
} else {
$this->rawData = $oData;
$this->parseDataAttribute();
}
}
$this->parseLink();
}
Expand Down
2 changes: 0 additions & 2 deletions vendor/composer/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Copyright (c) Nils Adermann, Jordi Boggiano

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -18,4 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Loading

0 comments on commit a9aea76

Please sign in to comment.