Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Service/SubmissionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ private function escapeCSV(string $value): string {
* @param array $question the question with its options
*/
private static function isShownToRespondents(array $question): bool {
if (preg_match('/^[\s\p{Z}\x{FEFF}]*$/u', (string)($question['text'] ?? '')) === 1) {
if (preg_match('/^[\t\n\x0B\f\r\p{Z}\x{FEFF}]*$/u', (string)($question['text'] ?? '')) === 1) {
return false;
}

Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Service/SubmissionServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,13 @@ public static function dataValidateSubmission() {
[],
null,
],
'required-with-next-line-title-is-shown' => [
[
['id' => 1, 'type' => 'short', 'text' => "\u{0085}\u{180E}", 'isRequired' => true]
],
[],
"Question \"\u{0085}\u{180E}\" is required.",
],
'required-choice-without-options-is-not-shown' => [
[
['id' => 1, 'type' => 'multiple_unique', 'text' => 'q1', 'isRequired' => true, 'options' => []]
Expand Down
Loading