Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Dev Fixed problematic comments
Dev Added pclzip library to ignore
  • Loading branch information
c-schmitz committed Nov 23, 2017
1 parent 67b8599 commit 38016cf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .scrutinizer.yml
@@ -1,5 +1,5 @@
filter:
excluded_paths: [framework/*, locale/*, docs/*, fonts/*, third_party/*, application/extensions/*, application/views/*, application/third_party/*, images/*, styles/*, styles-public/*, templates/*, themes/*, tmp/*, upload/*]
excluded_paths: [framework/*, locale/*, docs/*, fonts/*, third_party/*, application/libraries/admin/pclzip/*, application/extensions/*, application/views/*, application/third_party/*, images/*, styles/*, styles-public/*, templates/*, themes/*, tmp/*, upload/*]
paths: [application/*]
checks:
php:
Expand Down
3 changes: 1 addition & 2 deletions application/core/LSYii_Application.php
Expand Up @@ -105,8 +105,7 @@ public function initLanguage()
{
$this->setLanguage($this->request->getParam('lang'));
}
elseif (isset(App()->session['_lang'])) // See: http://www.yiiframework.com/wiki/26/setting-and-maintaining-the-language-in-application-i18n/
{
elseif (isset(App()->session['_lang'])) { // See: http://www.yiiframework.com/wiki/26/setting-and-maintaining-the-language-in-application-i18n/
$this->setLanguage(App()->session['_lang']);
}

Expand Down
3 changes: 1 addition & 2 deletions application/core/plugins/Authdb/Authdb.php
Expand Up @@ -141,8 +141,7 @@ public function newUserSession()
$this->setAuthFailure(self::ERROR_USERNAME_INVALID);
return;
}
if ($user !== null && ($username != $user->users_name && $username != $user->email)) // Control of equality for uppercase/lowercase with mysql
{
if ($user !== null && ($username != $user->users_name && $username != $user->email)) { // Control of equality for uppercase/lowercase with mysql
$this->setAuthFailure(self::ERROR_USERNAME_INVALID);
return;
}
Expand Down
31 changes: 8 additions & 23 deletions application/helpers/admin/htmleditor_helper.php
Expand Up @@ -132,47 +132,32 @@ function getEditor($fieldtype, $fieldname, $fieldtext, $surveyID = null, $gID =
//error_log("TIBO fieldtype=$fieldtype,fieldname=$fieldname,fieldtext=$fieldtext,surveyID=$surveyID,gID=$gID,qID=$qID,action=$action");
$session = &Yii::app()->session;

if ($session['htmleditormode'] &&
$session['htmleditormode'] == 'none')
{
if ($session['htmleditormode'] && $session['htmleditormode'] == 'none') {
return '';
}


if (!$session['htmleditormode'] ||
($session['htmleditormode'] != 'inline' &&
$session['htmleditormode'] != 'popup'))
{
$htmleditormode = Yii::app()->getConfig('defaulthtmleditormode');
}
else
{
if (!$session['htmleditormode'] || ($session['htmleditormode'] != 'inline' && $session['htmleditormode'] != 'popup')) {
$htmleditormode = Yii::app()->getConfig('defaulthtmleditormode');
} else {
$htmleditormode = $session['htmleditormode'];
}
if ($surveyID && getEmailFormat($surveyID) != 'html' && substr($fieldtype, 0, 6) === "email-")// email but survey as text email
{
if ($surveyID && getEmailFormat($surveyID) != 'html' && substr($fieldtype, 0, 6) === "email-") { // email but survey as text email
return '';
}

if ($htmleditormode == 'popup' ||
($fieldtype == 'editanswer' ||
$fieldtype == 'addanswer' ||
$fieldtype == 'editlabel' ||
$fieldtype == 'addlabel') && (preg_match("/^translate/", $action) == 0))
if ($htmleditormode == 'popup' || ($fieldtype == 'editanswer' ||$fieldtype == 'addanswer' || $fieldtype == 'editlabel' || $fieldtype == 'addlabel') && (preg_match("/^translate/", $action) == 0))
{
return getPopupEditor($fieldtype, $fieldname, $fieldtext, $surveyID, $gID, $qID, $action);
} elseif ($htmleditormode == 'inline')
{
} elseif ($htmleditormode == 'inline') {
return getInlineEditor($fieldtype, $fieldname, $fieldtext, $surveyID, $gID, $qID, $action);
} else
{
} else {
return '';
}
}

function getPopupEditor($fieldtype, $fieldname, $fieldtext, $surveyID = null, $gID = null, $qID = null, $action = null)
{

$htmlcode = '';

if ($fieldtype == 'editanswer' ||
Expand Down
9 changes: 3 additions & 6 deletions application/libraries/Save.php
Expand Up @@ -213,13 +213,11 @@ function savedcontrol()
$this->aSaveErrors[] = gT("You may not use slashes or ampersands in your name or password.");
return;
}
elseif (!empty($duplicate) && $duplicate->count() > 0) // OK - AR count
{
elseif (!empty($duplicate) && $duplicate->count() > 0) { // OK - AR count
$this->aSaveErrors[] = gT("This name has already been used for this survey. You must use a unique save name.");
return;
}
elseif (!empty($_POST['saveemail']) && !validateEmailAddress($_POST['saveemail'])) // Check if the email address is valid
{
elseif (!empty($_POST['saveemail']) && !validateEmailAddress($_POST['saveemail'])) { // Check if the email address is valid
$errormsg .= gT("This is not a valid email address. Please provide a valid email address or leave it empty.")."<br />\n";
return;
}
Expand All @@ -235,8 +233,7 @@ function savedcontrol()
"startlanguage" => $_SESSION['survey_'.$surveyid]['s_lang'],
"refurl" => ((isset($_SESSION['survey_'.$surveyid]['refurl'])) ? $_SESSION['survey_'.$surveyid]['refurl'] : getenv('HTTP_REFERER'))
);
if (SurveyDynamic::model($thissurvey['sid'])->insert($sdata)) // Checked
{
if (SurveyDynamic::model($thissurvey['sid'])->insert($sdata)) {
$srid = getLastInsertID($survey->responsesTableName);
$_SESSION['survey_'.$surveyid]['srid'] = $srid;
}
Expand Down

0 comments on commit 38016cf

Please sign in to comment.