Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Jun 8, 2022
2 parents eb606b4 + 59ad72d commit 396938a
Show file tree
Hide file tree
Showing 272 changed files with 3,048 additions and 2,523 deletions.
34 changes: 20 additions & 14 deletions application/helpers/remotecontrol/remotecontrol_handle.php
Expand Up @@ -1654,26 +1654,32 @@ public function get_question_properties($sSessionKey, $iQuestionID, $aQuestionSe
$aResult[$sPropertyName] = 'No available answers';
}
} elseif ($sPropertyName == 'attributes') {
$oAttributes = QuestionAttribute::model()->findAllByAttributes(array('qid' => $iQuestionID, 'language' => null), array('order' => 'attribute'));
if (count($oAttributes) > 0) {
$aData = array();
foreach ($oAttributes as $oAttribute) {
$aData[$oAttribute['attribute']] = $oAttribute['value'];
$questionAttributeHelper = new LimeSurvey\Models\Services\QuestionAttributeHelper();
$questionAttributes = $questionAttributeHelper->getQuestionAttributesWithValues($oQuestion, null, null, true);
$data = [];
foreach ($questionAttributes as $attributeName => $attributeData) {
if (empty($attributeData['i18n'])) {
$data[$attributeName] = $attributeData['value'];
}

$aResult['attributes'] = $aData;
}
if (count($data) > 0) {
ksort($data, SORT_NATURAL | SORT_FLAG_CASE);
$aResult['attributes'] = $data;
} else {
$aResult['attributes'] = 'No available attributes';
}
} elseif ($sPropertyName == 'attributes_lang') {
$oAttributes = QuestionAttribute::model()->findAllByAttributes(array('qid' => $iQuestionID, 'language' => $sLanguage), array('order' => 'attribute'));
if (count($oAttributes) > 0) {
$aData = array();
foreach ($oAttributes as $oAttribute) {
$aData[$oAttribute['attribute']] = $oAttribute['value'];
$questionAttributeHelper = new LimeSurvey\Models\Services\QuestionAttributeHelper();
$questionAttributes = $questionAttributeHelper->getQuestionAttributesWithValues($oQuestion, $sLanguage, null, true);
$data = [];
foreach ($questionAttributes as $attributeName => $attributeData) {
if (!empty($attributeData['i18n'])) {
$data[$attributeName] = $attributeData[$sLanguage]['value'];
}

$aResult['attributes_lang'] = $aData;
}
if (count($data) > 0) {
ksort($data, SORT_NATURAL | SORT_FLAG_CASE);
$aResult['attributes_lang'] = $data;
} else {
$aResult['attributes_lang'] = 'No available attributes';
}
Expand Down
13 changes: 9 additions & 4 deletions application/libraries/PluginManager/PluginBase.php
Expand Up @@ -530,13 +530,18 @@ protected function configIsNewVersion()

/**
* Saves the new version from config into database
* @return boolean
* @return void
*/
protected function saveNewVersion()
{
$pluginModel = \Plugin::model()->findByPk($this->id);
$pluginModel->version = (string) $this->config->metadata->version;
return $pluginModel->update();
\Yii::app()->db->createCommand()->update(
'{{plugins}}',
['version' => (string)$this->config->metadata->version],
'id=:id',
[
':id' => $this->id
]
);
}

/**
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Expand Up @@ -38,9 +38,11 @@
"require": {
"paragonie/sodium_compat": "^1.14",
"twig/twig": "1.44.2",
"phpseclib/bcmath_compat": "1.0.4",
"phpseclib/bcmath_compat": "^2.0",
"phpseclib/phpseclib": "^3.0",
"tiamo/spss": "^2.2",
"yiiext/twig-renderer":"dev-master"
"yiiext/twig-renderer":"dev-master",
"symfony/polyfill-mbstring": "^1.26"
},
"config": {
"vendor-dir": "third_party",
Expand Down
42 changes: 21 additions & 21 deletions third_party/composer/InstalledVersions.php
Expand Up @@ -25,24 +25,24 @@ class InstalledVersions
private static $installed = array (
'root' =>
array (
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '0417917dc15116766d0143117d9176cf5aa60bc4',
'reference' => 'a71b463ecacc8912444df68b68cea66ec8927415',
'name' => 'limesurvey/limesurvey',
),
'versions' =>
array (
'limesurvey/limesurvey' =>
array (
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '0417917dc15116766d0143117d9176cf5aa60bc4',
'reference' => 'a71b463ecacc8912444df68b68cea66ec8927415',
),
'paragonie/constant_time_encoding' =>
array (
Expand All @@ -64,48 +64,48 @@ class InstalledVersions
),
'paragonie/sodium_compat' =>
array (
'pretty_version' => 'v1.17.0',
'version' => '1.17.0.0',
'pretty_version' => 'v1.17.1',
'version' => '1.17.1.0',
'aliases' =>
array (
),
'reference' => 'c59cac21abbcc0df06a3dd18076450ea4797b321',
'reference' => 'ac994053faac18d386328c91c7900f930acadf1e',
),
'phpseclib/bcmath_compat' =>
array (
'pretty_version' => '1.0.4',
'version' => '1.0.4.0',
'pretty_version' => '2.0.1',
'version' => '2.0.1.0',
'aliases' =>
array (
),
'reference' => 'f805922db4b3d8c1e174dafb74ac7374264e8880',
'reference' => '2ffea8bfe1702b4535a7b3c2649c4301968e9a3c',
),
'phpseclib/phpseclib' =>
array (
'pretty_version' => '3.0.12',
'version' => '3.0.12.0',
'pretty_version' => '3.0.14',
'version' => '3.0.14.0',
'aliases' =>
array (
),
'reference' => '89bfb45bd8b1abc3b37e910d57f5dbd3174f40fb',
'reference' => '2f0b7af658cbea265cbb4a791d6c29a6613f98ef',
),
'symfony/polyfill-ctype' =>
array (
'pretty_version' => 'v1.24.0',
'version' => '1.24.0.0',
'pretty_version' => 'v1.26.0',
'version' => '1.26.0.0',
'aliases' =>
array (
),
'reference' => '30885182c981ab175d4d034db0f6f469898070ab',
'reference' => '6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4',
),
'symfony/polyfill-mbstring' =>
array (
'pretty_version' => 'v1.24.0',
'version' => '1.24.0.0',
'pretty_version' => 'v1.26.0',
'version' => '1.26.0.0',
'aliases' =>
array (
),
'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825',
'reference' => '9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e',
),
'tiamo/spss' =>
array (
Expand Down
42 changes: 21 additions & 21 deletions third_party/composer/installed.php
@@ -1,24 +1,24 @@
<?php return array (
'root' =>
array (
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '0417917dc15116766d0143117d9176cf5aa60bc4',
'reference' => 'a71b463ecacc8912444df68b68cea66ec8927415',
'name' => 'limesurvey/limesurvey',
),
'versions' =>
array (
'limesurvey/limesurvey' =>
array (
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '0417917dc15116766d0143117d9176cf5aa60bc4',
'reference' => 'a71b463ecacc8912444df68b68cea66ec8927415',
),
'paragonie/constant_time_encoding' =>
array (
Expand All @@ -40,48 +40,48 @@
),
'paragonie/sodium_compat' =>
array (
'pretty_version' => 'v1.17.0',
'version' => '1.17.0.0',
'pretty_version' => 'v1.17.1',
'version' => '1.17.1.0',
'aliases' =>
array (
),
'reference' => 'c59cac21abbcc0df06a3dd18076450ea4797b321',
'reference' => 'ac994053faac18d386328c91c7900f930acadf1e',
),
'phpseclib/bcmath_compat' =>
array (
'pretty_version' => '1.0.4',
'version' => '1.0.4.0',
'pretty_version' => '2.0.1',
'version' => '2.0.1.0',
'aliases' =>
array (
),
'reference' => 'f805922db4b3d8c1e174dafb74ac7374264e8880',
'reference' => '2ffea8bfe1702b4535a7b3c2649c4301968e9a3c',
),
'phpseclib/phpseclib' =>
array (
'pretty_version' => '3.0.12',
'version' => '3.0.12.0',
'pretty_version' => '3.0.14',
'version' => '3.0.14.0',
'aliases' =>
array (
),
'reference' => '89bfb45bd8b1abc3b37e910d57f5dbd3174f40fb',
'reference' => '2f0b7af658cbea265cbb4a791d6c29a6613f98ef',
),
'symfony/polyfill-ctype' =>
array (
'pretty_version' => 'v1.24.0',
'version' => '1.24.0.0',
'pretty_version' => 'v1.26.0',
'version' => '1.26.0.0',
'aliases' =>
array (
),
'reference' => '30885182c981ab175d4d034db0f6f469898070ab',
'reference' => '6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4',
),
'symfony/polyfill-mbstring' =>
array (
'pretty_version' => 'v1.24.0',
'version' => '1.24.0.0',
'pretty_version' => 'v1.26.0',
'version' => '1.26.0.0',
'aliases' =>
array (
),
'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825',
'reference' => '9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e',
),
'tiamo/spss' =>
array (
Expand Down
11 changes: 7 additions & 4 deletions third_party/phpseclib/bcmath_compat/composer.json
@@ -1,6 +1,6 @@
{
"name": "phpseclib/bcmath_compat",
"description": "PHP 5.x/7.x polyfill for bcmath extension",
"description": "PHP 5.x-8.x polyfill for bcmath extension",
"keywords": [
"bcmath",
"math",
Expand All @@ -23,10 +23,10 @@
"source": "https://github.com/phpseclib/bcmath_compat"
},
"require": {
"phpseclib/phpseclib": ">=2.0.19"
"phpseclib/phpseclib": "^3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35|^5.7|^6.0",
"phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4",
"squizlabs/php_codesniffer": "^3.0"
},
"suggest": {
Expand All @@ -42,5 +42,8 @@
"test": "phpunit",
"check-style": "phpcs src tests",
"fix-style": "phpcbf src tests"
},
"provide": {
"ext-bcmath": "8.1.0"
}
}
}
33 changes: 33 additions & 0 deletions third_party/phpseclib/bcmath_compat/lib/bcmath.php
Expand Up @@ -149,4 +149,37 @@ function bcsub($left_operand, $right_operand, $scale = 0)
{
return BCMath::sub($left_operand, $right_operand, $scale);
}
}

// the following were introduced in PHP 7.0.0
if (!class_exists('Error')) {
class Error extends Exception
{
}

class ArithmeticError extends Error
{
}

class DivisionByZeroError extends ArithmeticError
{
}

class TypeError extends Error
{
}
}

// the following was introduced in PHP 7.1.0
if (!class_exists('ArgumentCountError')) {
class ArgumentCountError extends TypeError
{
}
}

// the following was introduced in PHP 8.0.0
if (!class_exists('ValueError')) {
class ValueError extends Error
{
}
}

0 comments on commit 396938a

Please sign in to comment.