| @@ -100,9 +100,9 @@ | ||
| 100 | 100 | $input = sanitize_text_field($input); |
| 101 | 101 | } |
| 102 | 102 | } elseif (is_array($input)) { |
| 103 | 103 | $sanitizedInput = []; |
| 104 | - | |
| 104 | + | |
| 105 | 105 | foreach ($input as $key => &$value) { |
| 106 | 106 | $key = fluentFormSanitizer($key); |
| 107 | 107 | // Local var: mutating $attribute here would collapse every sibling |
| 108 | 108 | // after the first onto a bare key, resolving nested inputs to the wrong element. |
| @@ -110,9 +110,9 @@ | ||
| 110 | 110 | |
| 111 | 111 | $value = fluentFormSanitizer($value, $childAttribute, $fields); |
| 112 | 112 | $sanitizedInput[$key] = $value; |
| 113 | 113 | } |
| 114 | - | |
| 114 | + | |
| 115 | 115 | $input = $sanitizedInput; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | return $input; |
| @@ -211,13 +211,13 @@ | ||
| 211 | 211 | |
| 212 | 212 | function fluentFormIsHandlingSubmission() |
| 213 | 213 | { |
| 214 | 214 | $status = fluentFormWasSubmitted() || isWpAsyncRequest('fluentform_async_request'); |
| 215 | - | |
| 215 | + | |
| 216 | 216 | $status = apply_filters_deprecated( |
| 217 | 217 | 'fluentform_is_handling_submission', |
| 218 | 218 | [ |
| 219 | - $status | |
| 219 | + $status, | |
| 220 | 220 | ], |
| 221 | 221 | FLUENTFORM_FRAMEWORK_UPGRADE, |
| 222 | 222 | 'fluentform/is_handling_submission', |
| 223 | 223 | 'Use fluentform/is_handling_submission instead of fluentform_is_handling_submission' |
| @@ -322,24 +322,8 @@ | ||
| 322 | 322 | { |
| 323 | 323 | return \FluentForm\App\Helpers\Helper::sanitizeAdvancedOptions($options); |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | -function fluentform_iframe_srcdoc_sanitize($value) | |
| 327 | -{ | |
| 328 | - $tags = wp_kses_allowed_html('post'); | |
| 329 | - $tags['style'] = [ | |
| 330 | - 'types' => [], | |
| 331 | - ]; | |
| 332 | - // Check if decoding is necessary | |
| 333 | - if (strpos($value, '&') !== false) { | |
| 334 | - // Decode HTML entities | |
| 335 | - $value = html_entity_decode($value, ENT_QUOTES | ENT_HTML5, 'UTF-8'); | |
| 336 | - $value = stripslashes($value); | |
| 337 | - } | |
| 338 | - return wp_kses($value, $tags); | |
| 339 | -} | |
| 340 | - | |
| 341 | - | |
| 342 | 326 | function fluentform_sanitize_html($html) |
| 343 | 327 | { |
| 344 | 328 | if (!$html) { |
| 345 | 329 | return $html; |
| @@ -359,11 +343,8 @@ | ||
| 359 | 343 | $tags['iframe'] = [ |
| 360 | 344 | 'width' => [], |
| 361 | 345 | 'height' => [], |
| 362 | 346 | 'src' => [], |
| 363 | - 'srcdoc' => [ | |
| 364 | - 'value_callback' => 'fluentform_iframe_srcdoc_sanitize' | |
| 365 | - ], | |
| 366 | 347 | 'title' => [], |
| 367 | 348 | 'frameborder' => [], |
| 368 | 349 | 'allow' => [], |
| 369 | 350 | 'class' => [], |
| @@ -370,9 +351,9 @@ | ||
| 370 | 351 | 'id' => [], |
| 371 | 352 | 'allowfullscreen' => [], |
| 372 | 353 | 'style' => [], |
| 373 | 354 | ]; |
| 374 | - | |
| 355 | + | |
| 375 | 356 | //svg |
| 376 | 357 | if (empty($tags['svg'])) { |
| 377 | 358 | $svg_args = [ |
| 378 | 359 | 'svg' => [ |
| @@ -387,9 +368,9 @@ | ||
| 387 | 368 | 'fill' => true, |
| 388 | 369 | 'stroke' => true, |
| 389 | 370 | 'stroke-width' => true, |
| 390 | 371 | 'stroke-linecap' => true, |
| 391 | - 'stroke-linejoin' => true | |
| 372 | + 'stroke-linejoin' => true, | |
| 392 | 373 | ], |
| 393 | 374 | 'g' => ['fill' => true], |
| 394 | 375 | 'title' => ['title' => true], |
| 395 | 376 | 'path' => [ |
| @@ -397,18 +378,18 @@ | ||
| 397 | 378 | 'fill' => true, |
| 398 | 379 | 'transform' => true, |
| 399 | 380 | ], |
| 400 | 381 | 'polyline' => [ |
| 401 | - 'points' => true | |
| 402 | - ] | |
| 382 | + 'points' => true, | |
| 383 | + ], | |
| 403 | 384 | ]; |
| 404 | 385 | $tags = array_merge($tags, $svg_args); |
| 405 | 386 | } |
| 406 | - | |
| 387 | + | |
| 407 | 388 | $tags = apply_filters_deprecated( |
| 408 | 389 | 'fluentform_allowed_html_tags', |
| 409 | 390 | [ |
| 410 | - $tags | |
| 391 | + $tags, | |
| 411 | 392 | ], |
| 412 | 393 | FLUENTFORM_FRAMEWORK_UPGRADE, |
| 413 | 394 | 'fluentform/allowed_html_tags', |
| 414 | 395 | 'Use fluentform/allowed_html_tags instead of fluentform_allowed_html_tags' |
| @@ -440,18 +421,8 @@ | ||
| 440 | 421 | |
| 441 | 422 | return preg_replace('/<\/?script[^>]*>/is', '', $content); |
| 442 | 423 | } |
| 443 | 424 | |
| 444 | -function fluentform_sanitize_json_object($value) | |
| 445 | -{ | |
| 446 | - return \FluentForm\App\Services\FormBuilder\DateConfigNormalizer::sanitize($value); | |
| 447 | -} | |
| 448 | - | |
| 449 | -function fluentform_date_config_to_js($json) | |
| 450 | -{ | |
| 451 | - return \FluentForm\App\Services\FormBuilder\DateConfigNormalizer::toJs($json); | |
| 452 | -} | |
| 453 | - | |
| 454 | 425 | /** |
| 455 | 426 | * Sanitize inputs recursively. |
| 456 | 427 | * |
| 457 | 428 | * @param array $input |
| @@ -490,9 +461,9 @@ | ||
| 490 | 461 | // Convert to string if not already |
| 491 | 462 | if (!is_string($css)) { |
| 492 | 463 | $css = (string) $css; |
| 493 | 464 | } |
| 494 | - | |
| 465 | + | |
| 495 | 466 | return preg_match('#</?\w+#', $css) ? '' : $css; |
| 496 | 467 | } |
| 497 | 468 | |
| 498 | 469 | function fluentformCanUnfilteredHTML() |