create-prisma-php-app 1.15.3 → 1.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -243,7 +243,7 @@ class Auth
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
$authCode = Validator::
|
|
246
|
+
$authCode = Validator::string($_GET['code'] ?? '');
|
|
247
247
|
|
|
248
248
|
if ($isGet && in_array('callback', $dynamicRouteParams[self::PPHPAUTH]) && isset($authCode)) {
|
|
249
249
|
if (in_array('github', $dynamicRouteParams[self::PPHPAUTH])) {
|
|
@@ -59,7 +59,7 @@ class FormHandler
|
|
|
59
59
|
if ($this->isPost) {
|
|
60
60
|
if ($inputField = $this->stateManager->getState(self::FORM_INPUT_REGISTER)) {
|
|
61
61
|
foreach ($inputField as $field => $fieldData) {
|
|
62
|
-
$this->data[$field] = Validator::
|
|
62
|
+
$this->data[$field] = Validator::string($this->data[$field] ?? '');
|
|
63
63
|
$this->validateField($field, $fieldData['rules']);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -134,7 +134,7 @@ class FormHandler
|
|
|
134
134
|
return "id='fh-error-$field' data-error-message='$message'";
|
|
135
135
|
};
|
|
136
136
|
|
|
137
|
-
$field = Validator::
|
|
137
|
+
$field = Validator::string($field);
|
|
138
138
|
$state = $this->stateManager->getState(self::FORM_INPUT_ERRORS);
|
|
139
139
|
|
|
140
140
|
if ($this->validated && $state) {
|
|
@@ -188,7 +188,7 @@ class FormHandler
|
|
|
188
188
|
*/
|
|
189
189
|
public function validateField($field, $rules)
|
|
190
190
|
{
|
|
191
|
-
$value = Validator::
|
|
191
|
+
$value = Validator::string($this->data[$field] ?? null);
|
|
192
192
|
|
|
193
193
|
if (!isset($rules['required']) && empty($value)) {
|
|
194
194
|
return;
|
|
@@ -269,7 +269,7 @@ class FormHandler
|
|
|
269
269
|
*/
|
|
270
270
|
public function register($fieldName, $rules = []): string
|
|
271
271
|
{
|
|
272
|
-
$value = Validator::
|
|
272
|
+
$value = Validator::string($this->data[$fieldName] ?? '');
|
|
273
273
|
|
|
274
274
|
$isTypeButton = array_key_exists('button', $rules);
|
|
275
275
|
$attributes = "";
|
|
@@ -411,7 +411,7 @@ class FormHandler
|
|
|
411
411
|
*/
|
|
412
412
|
public function watch(string $field)
|
|
413
413
|
{
|
|
414
|
-
$field = Validator::
|
|
414
|
+
$field = Validator::string($field);
|
|
415
415
|
$fieldData = $this->data[$field] ?? '';
|
|
416
416
|
return "id='fh-watch-$field' data-watch-value='$fieldData' data-type='watch'";
|
|
417
417
|
}
|
|
@@ -64,11 +64,11 @@ class Mailer
|
|
|
64
64
|
public function send(string $to, string $subject, string $body, string $name = '', string $altBody = ''): bool
|
|
65
65
|
{
|
|
66
66
|
try {
|
|
67
|
-
Validator::
|
|
68
|
-
Validator::
|
|
69
|
-
Validator::
|
|
70
|
-
Validator::
|
|
71
|
-
Validator::
|
|
67
|
+
Validator::string($to);
|
|
68
|
+
Validator::string($subject);
|
|
69
|
+
Validator::string($body);
|
|
70
|
+
Validator::string($name);
|
|
71
|
+
Validator::string($altBody);
|
|
72
72
|
|
|
73
73
|
$this->mail->addAddress($to, $name);
|
|
74
74
|
$this->mail->isHTML(true);
|