Skip to content

Commit b58d7e1

Browse files
committed
safe help block path
1 parent 593040a commit b58d7e1

File tree

12 files changed

+22
-11
lines changed

12 files changed

+22
-11
lines changed

src/helpers.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
use Kris\LaravelFormBuilder\Fields\FormField;
44
use Kris\LaravelFormBuilder\Form;
55

6+
7+
if(!function_exists('helpBlockPath'))
8+
{
9+
10+
function helpBlockPath()
11+
{
12+
return __DIR__.'/views/help_block.php';
13+
}
14+
15+
}
16+
617
if (!function_exists('form')) {
718

819
function form(Form $form, array $options = [])

src/views/button.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<?php endif; ?>
44

55
<?= Form::button($options['label'], $options['attr']) ?>
6-
<?php include 'help_block.php' ?>
6+
<?php include helpBlockPath(); ?>
77

88
<?php if ($options['wrapper'] !== false): ?>
99
</div>

src/views/checkbox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<?= Form::customLabel($name, $options['label'], $options['label_attr']) ?>
1212
<?php endif; ?>
1313

14-
<?php include 'help_block.php' ?>
14+
<?php include helpBlockPath(); ?>
1515
<?php endif; ?>
1616

1717
<?php include 'errors.php' ?>

src/views/child_form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<?php } ?>
1616
<?php endforeach; ?>
1717

18-
<?php include 'help_block.php' ?>
18+
<?php include helpBlockPath(); ?>
1919

2020
<?php endif; ?>
2121

src/views/choice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<?= $child->render($options['choice_options'], true, true, false) ?>
1414
<?php endforeach; ?>
1515

16-
<?php include 'help_block.php' ?>
16+
<?php include helpBlockPath(); ?>
1717

1818
<?php endif; ?>
1919

src/views/collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<?= $child->render() ?>
1414
<?php endforeach; ?>
1515

16-
<?php include 'help_block.php' ?>
16+
<?php include helpBlockPath(); ?>
1717

1818
<?php endif; ?>
1919

src/views/radio.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<?= Form::customLabel($name, $options['label'], $options['label_attr']) ?>
1212
<?php endif; ?>
1313

14-
<?php include 'help_block.php' ?>
14+
<?php include helpBlockPath(); ?>
1515
<?php endif; ?>
1616

1717
<?php include 'errors.php' ?>

src/views/repeated.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<?= $options['children']['first']->render([], true, true, false) ?>
99
<?= $options['children']['second']->render([], true, true, false) ?>
1010

11-
<?php include 'help_block.php' ?>
11+
<?php include helpBlockPath(); ?>
1212

1313
<?php endif; ?>
1414

src/views/select.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<?php if ($showField): ?>
1212
<?php $emptyVal = $options['empty_value'] ? ['' => $options['empty_value']] : null; ?>
1313
<?= Form::select($name, (array)$emptyVal + $options['choices'], $options['selected'], $options['attr']) ?>
14-
<?php include 'help_block.php' ?>
14+
<?php include helpBlockPath(); ?>
1515
<?php endif; ?>
1616

1717
<?php include 'errors.php' ?>

src/views/static.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<?php if ($showField): ?>
1212
<<?= $options['tag'] ?> <?= $options['elemAttrs'] ?>><?= e($options['value']) ?></<?= $options['tag'] ?>>
1313

14-
<?php include 'help_block.php' ?>
14+
<?php include helpBlockPath(); ?>
1515

1616
<?php endif; ?>
1717

0 commit comments

Comments
 (0)