PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.8
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
← All changes | inc/class-lp-helper.php +9 -3 4.4.54.4.8 View file →
@@ -533,19 +533,25 @@
533 533 * @param array $data
534 534 * @param array $tag_args as ['type' => 'text/javascript', 'id' => '']
535 535 *
536 536 * @return void
537 - * @version 1.0.1
537 + * @version 1.0.2
538 538 * @since 4.2.5.5
539 539 */
540 540 public static function print_inline_script_tag( string $name_variable_script, array $data, array $tag_args = [] ) {
541 - foreach ( $data as $key => $value ) {
541 + /**
542 + * Comment block code reason by security
543 + * wp_json_encode() already produces a valid JavaScript string,
544 + * and there is no reason to decode HTML entities inside data that will be re-inserted with insertAdjacentHTML
545 + * @comment since 4.4.8
546 + */
547 + /*foreach ( $data as $key => $value ) {
542 548 if ( ! is_scalar( $value ) ) {
543 549 continue;
544 550 }
545 551
546 552 $data[ $key ] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' );
547 - }
553 + }*/
548 554
549 555 $data_json = wp_json_encode( $data );
550 556 $script = '';
551 557 if ( ! empty( $name_variable_script ) ) {