Skip to content

Commit

Permalink
Merge branch 'hotfix/v0.17.16'
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenarslan committed Aug 15, 2018
2 parents 84a8ceb + cfcc179 commit 169bb60
Show file tree
Hide file tree
Showing 9 changed files with 156 additions and 127 deletions.
2 changes: 1 addition & 1 deletion application/Model/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public function sendMail($who = NULL) {
else:
$error = sprintf("We already sent %d mail to this recipient in the last minute. No email was sent.", $mails_sent['in_last_1m']);
endif;
elseif ($mails_sent['in_last_10m'] > 0):
elseif ($mails_sent['in_last_10m'] > 1):
if($mails_sent['in_last_10m'] < 10 && $testing):
$warning = sprintf("We already sent %d mail to this recipient in the last 10 minutes. An email was sent, because you're currently testing, but it would have been delayed for a real user, to avoid allegations of spamming.", $mails_sent['in_last_10m']);
else:
Expand Down
9 changes: 5 additions & 4 deletions application/Model/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,11 @@ public function __construct($options = array()) {
$this->js_showif = preg_replace("/FALSE/", "false", $this->js_showif); // uppercase, R, FALSE, to lowercase, JS, false
$this->js_showif = preg_replace("/TRUE/", "true", $this->js_showif); // uppercase, R, TRUE, to lowercase, JS, true
$quoted_string = "([\"'])((\\\\{2})*|(.*?[^\\\\](\\\\{2})*))\\1";
$this->js_showif = preg_replace("/\s*\%contains\%\s*" . $quoted_string . "/", ".indexOf($1$2$1) > -1", $this->js_showif);
$this->js_showif = preg_replace("/\s*\%begins_with\%\s*" . $quoted_string . "/", ".indexOf($1$2$1) === 0", $this->js_showif);
$this->js_showif = preg_replace("/\s*\%starts_with\%\s*" . $quoted_string . "/", ".indexOf($1$2$1) === 0", $this->js_showif);
$this->js_showif = preg_replace("/\s*\%ends_with\%\s*" . $quoted_string . "/", ".endsWith($1$2$1)", $this->js_showif);
$this->js_showif = preg_replace("/\s*\%contains\%\s*" . $quoted_string . "/", ".toString().indexOf($1$2$1) > -1", $this->js_showif);
$this->js_showif = preg_replace("/\s*\%contains_word\%\s*" . $quoted_string . "/", ".toString().match(/\\b$2\\b/) !== null", $this->js_showif);
$this->js_showif = preg_replace("/\s*\%begins_with\%\s*" . $quoted_string . "/", ".toString().indexOf($1$2$1) === 0", $this->js_showif);
$this->js_showif = preg_replace("/\s*\%starts_with\%\s*" . $quoted_string . "/", ".toString().indexOf($1$2$1) === 0", $this->js_showif);
$this->js_showif = preg_replace("/\s*\%ends_with\%\s*" . $quoted_string . "/", ".toString().endsWith($1$2$1)", $this->js_showif);
$this->js_showif = preg_replace("/\s*stringr::str_length\(([a-zA-Z0-9_'\"]+)\)/", "$1.length", $this->js_showif);

if (strstr($this->showif, "//js_only") !== false) {
Expand Down
4 changes: 2 additions & 2 deletions application/Model/SpreadsheetReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,8 @@ private function readChoicesSheet(PHPExcel_Worksheet $worksheet) {
unset($data[$rowNumber]);
continue 2;
}
if (!preg_match("/^[a-zA-Z0-9_]{1,255}$/", $cellValue)) {
$this->errors[] = __("The choice name '%s' is invalid. It has to be between 1 and 255 characters long. It may not contain anything other than the characters from <strong>a</strong> to <strong>Z</strong>, <strong>0</strong> to <strong>9</strong> and the underscore.", $cellValue);
if (!preg_match("/^.{1,255}$/", $cellValue)) {
$this->errors[] = __("The choice name '%s' is invalid. It has to be between 1 and 255 characters long.", $cellValue);
}
//$data[$rowNumber]['name'] = $cellValue;

Expand Down
4 changes: 2 additions & 2 deletions application/View/admin/run/add_run.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
<li><i class="fa-li fa fa-exclamation-triangle"></i> This is the name that users will see in their browser's address bar for your study, possibly elsewhere too.</li>
<li><i class="fa-li fa fa-unlock"></i> It can be changed later, but it also changes the link to your study, so don't change it once you're live.</li>
<li><i class="fa-li fa fa-lightbulb-o"></i> Ideally, it should be the memorable name of your study.</li>
<li><i class="fa-li fa fa-edit"></i> Name should contain only alpha-numeric characters and no spaces.</li>
<li><i class="fa-li fa fa-edit"></i> Name should contain only alpha-numeric characters and no spaces. It needs to start with a letter.</li>
</ul>
</div>
<div class="form-group">
<input name="run_name" type="text" class="form-control" placeholder="Name (a to Z, 0 to 9 and _)">
<input name="run_name" type="text" class="form-control" placeholder="Name (a to Z, 0 to 9 and -)" pattern="^[a-zA-Z][a-zA-Z0-9-]$">
</div>
</div>
<div class="clear clearfix"></div>
Expand Down
7 changes: 7 additions & 0 deletions application/View/public/documentation/sample_survey_sheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,13 @@ class
<dd>
This makes answer labels for mc-family items stack up. Useful if you have so many options, that they jut out of the viewport. If you have very long list, consider using select-type items instead (they come with a search function).
</dd>

<dt>
mc_horizontal
</dt>
<dd>
This makes answer labels for mc-family items stay horizontal on small screens.
</dd>


<dt>
Expand Down
1 change: 1 addition & 0 deletions config-dist/css-classes.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"mc_width200",
"mc_equal_widths",
"mc_vertical",
"mc_horizontal",
"mc_block",
"mc_boxed",
"rotate_label30",
Expand Down
2 changes: 1 addition & 1 deletion webroot/assets/build/js/formr-material.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion webroot/assets/build/js/formr.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 169bb60

Please sign in to comment.