Skip to content

Commit 13114d5

Browse files
committed
Address H1 3247363
1 parent f317ecb commit 13114d5

File tree

6 files changed

+17
-9
lines changed

6 files changed

+17
-9
lines changed

attributes/textarea/form.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
<?php
2+
/**
3+
* @var Concrete\Core\Attribute\View $view
4+
* @var Concrete\Core\Form\Service\Form $form
5+
* @var string $akTextareaDisplayMode
6+
* @var string|null $value
7+
*/
8+
9+
$value = $value ?? '';
210

311
// switch display type here
412
if ($akTextareaDisplayMode == 'text' || $akTextareaDisplayMode == '') { ?>
513

614
<?php
715
echo $form->textarea(
816
$view->controller->field('value'),
9-
h($value),
17+
htmlspecialchars($value, ENT_QUOTES, APP_CHARSET),
1018
array('rows' => 5)
1119
);
1220
?>
@@ -27,11 +35,11 @@
2735
/*
2836
echo Core::make('editor')->outputSimpleEditor(
2937
$view->controller->field('value'),
30-
h($value)
38+
htmlspecialchars($value, ENT_QUOTES, APP_CHARSET)
3139
);*/
3240
echo Core::make('editor')->outputStandardEditor(
3341
$view->controller->field('value'),
34-
h($value)
42+
htmlspecialchars($value, ENT_QUOTES, APP_CHARSET)
3543
);
3644

3745
}

blocks/faq/form_setup_html.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
</div>
8080
<div class="form-group">
8181
<label class="control-label form-label"><?php echo t('Description'); ?></label>
82-
<textarea class='editor-content' name="description[]"><?php echo $row['description']; ?></textarea>
82+
<textarea class='editor-content' name="description[]"><?php echo htmlspecialchars((string) $row['description'], ENT_QUOTES, APP_CHARSET); ?></textarea>
8383
</div>
8484
<button type="button" class="btn btn-sm btn-secondary ccm-edit-entry" data-entry-close-text="<?php echo t('Collapse Entry'); ?>" data-entry-edit-text="<?php echo t('Edit Entry'); ?>"><?php echo t('Edit Entry'); ?></button>
8585
<button type="button" class="btn btn-sm btn-danger ccm-delete-faq-entry"><?php echo t('Remove'); ?></button>

blocks/feature/form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<?php echo $form->label('paragraph', t('Paragraph:'));?>
6161
<?php
6262
$editor = Core::make('editor');
63-
echo $editor->outputBlockEditModeEditor('paragraph', $controller->getParagraphEditMode());
63+
echo $editor->outputBlockEditModeEditor('paragraph', htmlspecialchars($controller->getParagraphEditMode(), ENT_QUOTES, APP_CHARSET));
6464
?>
6565
</div>
6666

blocks/feature_link/edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<div class="mb-3">
5353
<label class="form-label" for="body"><?=t('Body')?></label>
5454
<?php
55-
echo $editor->outputBlockEditModeEditor('body', isset($body) ? LinkAbstractor::translateFromEditMode($body) : null);
55+
echo $editor->outputBlockEditModeEditor('body', isset($body) ? htmlspecialchars(LinkAbstractor::translateFromEditMode($body), ENT_QUOTES, APP_CHARSET) : null);
5656
?>
5757
</div>
5858
</fieldset>

blocks/hero_image/edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<div class="mb-3">
4242
<label class="form-label" for="body"><?=t('Body')?></label>
4343
<?php
44-
echo $editor->outputBlockEditModeEditor('body', isset($body) ? LinkAbstractor::translateFromEditMode($body) : null);
44+
echo $editor->outputBlockEditModeEditor('body', isset($body) ? htmlspecialchars(LinkAbstractor::translateFromEditMode($body), ENT_QUOTES, APP_CHARSET) : null);
4545
?>
4646
</div>
4747
</fieldset>

blocks/image_slider/form_setup_html.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class="btn btn-success ccm-add-image-slider-entry ccm-add-image-slider-entry-<?p
240240
link_url: '<?php echo $row['linkURL']; ?>',
241241
link_type: '<?php echo $linkType; ?>',
242242
title: '<?php echo addslashes(h($row['title'])); ?>',
243-
description: '<?php echo str_replace(["\t", "\r", "\n"], "", addslashes(h($row['description']))); ?>',
243+
description: <?= json_encode((string) $row['description']) ?>,
244244
sort_order: '<?php echo $row['sortOrder']; ?>'
245245
}));
246246
sliderEntriesContainer.find('.ccm-image-slider-entry-<?php echo $bID; ?>:last-child div[data-field=entry-link-page-selector]').concretePageSelector({
@@ -460,7 +460,7 @@ class="btn btn-success ccm-add-image-slider-entry ccm-add-image-slider-entry-<?p
460460
<!--suppress HtmlFormInputWithoutLabel -->
461461
<textarea id="ccm-slide-editor-<%= _.uniqueId() %>" style="display: none"
462462
class="editor-content editor-content-<?php echo $bID; ?>"
463-
name="<?php echo $view->field('description'); ?>[]"><%=description%></textarea>
463+
name="<?php echo $view->field('description'); ?>[]"><%- description %></textarea>
464464
</div>
465465
<div class="form-group">
466466
<label class="control-label form-label"><?php echo t('Link'); ?></label>

0 commit comments

Comments
 (0)