Skip to content

Commit

Permalink
Scrutinizer Auto-Fixes
Browse files Browse the repository at this point in the history
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
  • Loading branch information
scrutinizer-auto-fixer committed Feb 3, 2018
1 parent bd2bbd4 commit 572277a
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 53 deletions.
2 changes: 1 addition & 1 deletion application/controllers/admin/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ private function actionInsertCopyQuestion($iSurveyID)
$newAnswer = new Answer();
$newAnswer->attributes = $qr1;
$newAnswer->qid = $this->iQuestionID;
if(!$newAnswer->save()){
if (!$newAnswer->save()) {
Yii::log(\CVarDumper::dumpAsString($newAnswer->getErrors()), 'warning', __METHOD__);
}
}
Expand Down
6 changes: 3 additions & 3 deletions application/core/LSCaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ protected function renderImage()
$this->imageOptions['id'] = $this->getId();
}

$url=$this->getController()->createUrl($this->captchaAction,array('v'=>uniqid()));
$alt=isset($this->imageOptions['alt'])?$this->imageOptions['alt']:'';
return CHtml::image($url,$alt,$this->imageOptions);
$url = $this->getController()->createUrl($this->captchaAction, array('v'=>uniqid()));
$alt = isset($this->imageOptions['alt']) ? $this->imageOptions['alt'] : '';
return CHtml::image($url, $alt, $this->imageOptions);
}
}
74 changes: 37 additions & 37 deletions application/core/LsDefaultDataSets.php

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion application/core/plugins/Authwebserver/Authwebserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ public function newUserSession()
$aUserProfile = $this->api->getConfigKey('auth_webserver_autocreate_profile');
}
} else {
if (Permission::model()->find('permission = :permission AND uid=:uid AND read_p =1', array(":permission" => 'auth_webserver', ":uid"=>$oUser->uid))) { // Don't use Permission::model()->hasGlobalPermission : it's update the plugins event (and remove user/pass from event)
if (Permission::model()->find('permission = :permission AND uid=:uid AND read_p =1', array(":permission" => 'auth_webserver', ":uid"=>$oUser->uid))) {
// Don't use Permission::model()->hasGlobalPermission : it's update the plugins event (and remove user/pass from event)
$this->setAuthSuccess($oUser);
return;
} else {
Expand Down
4 changes: 2 additions & 2 deletions application/helpers/SurveyRuntimeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1151,11 +1151,11 @@ private function moveSubmitIfNeeded()
// process string anyway so that it can be pretty-printed
$aStandardsReplacementFields = getStandardsReplacementFields($this->aSurveyInfo);

$this->aSurveyInfo['surveyls_url'] = LimeExpressionManager::ProcessString( $this->aSurveyInfo['surveyls_url'], null, $aStandardsReplacementFields);
$this->aSurveyInfo['surveyls_url'] = LimeExpressionManager::ProcessString($this->aSurveyInfo['surveyls_url'], null, $aStandardsReplacementFields);

}

$this->aSurveyInfo['aCompleted']['sSurveylsUrl'] = $this->aSurveyInfo['surveyls_url'];
$this->aSurveyInfo['aCompleted']['sSurveylsUrl'] = $this->aSurveyInfo['surveyls_url'];



Expand Down
6 changes: 3 additions & 3 deletions application/helpers/admin/import_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1713,15 +1713,15 @@ function XMLImportSurvey($sFullFilePath, $sXMLdata = null, $sNewSurveyName = nul
}
$questionAttribute = new QuestionAttribute();
$questionAttribute->attributes = $insertdata;
if(!$questionAttribute->save()){
if (!$questionAttribute->save()) {
safeDie(gT("Error").": Failed to insert data[7]<br />");
}

}
} else {
$questionAttribute = new QuestionAttribute();
$questionAttribute->attributes = $insertdata;
if(!$questionAttribute->save()){
if (!$questionAttribute->save()) {
safeDie(gT("Error").": Failed to insert data[8]<br />");
}
}
Expand Down Expand Up @@ -1884,7 +1884,7 @@ function XMLImportSurvey($sFullFilePath, $sXMLdata = null, $sNewSurveyName = nul
unset($insertdata['id']);
// now translate any links
$quotaMember->attributes = $insertdata;
if(!$quotaMember->save()){
if (!$quotaMember->save()) {
safeDie(gT("Error").": Failed to insert data[13]<br />");
}
$results['quotamembers']++;
Expand Down
7 changes: 5 additions & 2 deletions application/helpers/common_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2836,7 +2836,8 @@ function stripJavaScript($sContent)
function showJavaScript($sContent)
{
$text = preg_replace_callback('@<script[^>]*?>.*?</script>@si',
function($matches) {
function($matches)
{
return htmlspecialchars($matches[0]);
}, $sContent);
return $text;
Expand Down Expand Up @@ -3215,7 +3216,9 @@ function includeKeypad()
*/
function translateInsertansTags($newsid, $oldsid, $fieldnames)
{
uksort($fieldnames, function($a, $b) {return strlen($a) < strlen($b); });
uksort($fieldnames, function($a, $b)
{
return strlen($a) < strlen($b); });

Yii::app()->loadHelper('database');
$newsid = (int) $newsid;
Expand Down
2 changes: 1 addition & 1 deletion application/helpers/remotecontrol/remotecontrol_handle.php
Original file line number Diff line number Diff line change
Expand Up @@ -2990,7 +2990,7 @@ protected function _doLogin($sUsername, $sPassword, $sPlugin)
$event->set('password', $sPassword);
App()->getPluginManager()->dispatchEvent($event, array($sPlugin));
if (!$identity->authenticate()) {
if($identity->errorMessage) {
if ($identity->errorMessage) {
// don't return an empty string
return $identity->errorMessage;
}
Expand Down
2 changes: 1 addition & 1 deletion application/helpers/userstatistics_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1903,7 +1903,7 @@ protected function displayResults($outputs, $results, $rt, $outputType, $surveyi
$i = 0;

while (isset($gdata[$i])) {
if (isset($showaggregated_indice_table[$i]) && $showaggregated_indice_table[$i] == "aggregated") {
if (isset($showaggregated_indice_table[$i]) && $showaggregated_indice_table[$i] == "aggregated") {
// do nothing, we don't rewrite aggregated results
// or at least I don't know how !!! (lemeur)
} else {
Expand Down
4 changes: 2 additions & 2 deletions application/models/Assessment.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class Assessment extends LSActiveRecord
public function init()
{
parent::init();
if($this->isNewRecord){
if ($this->isNewRecord) {
// default values
if(empty($this->scope)) $this->scope = '0';
if (empty($this->scope)) $this->scope = '0';
}
}

Expand Down

0 comments on commit 572277a

Please sign in to comment.