Plugin Directory

Changeset 2845082


Ignore:
Timestamp:
01/08/2023 10:57:55 AM (2 years ago)
Author:
firmcatalyst
Message:

a critical issue for php7 fixed

Location:
fcp-first-screen-css
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • fcp-first-screen-css/tags/1.2/first-screen.php

    r2831794 r2845082  
    8686    add_action( 'wp_enqueue_scripts', $deregister_styles, 100000 );
    8787    add_action( 'wp_footer', $deregister_styles, 1 );
     88    add_action( 'wp_footer', $deregister_styles, 11 );
    8889
    8990
     
    392393
    393394    // try to escape tags inside svg with url-encoding
    394     if ( str_contains( $css, '<' ) && preg_match( '/<\/?\w+/', $css ) ) {
     395    if ( strpos( $css, '<' ) !== false && preg_match( '/<\/?\w+/', $css ) ) {
    395396        // the idea is taken from https://github.com/yoksel/url-encoder/
    396397        $svg_sanitized = preg_replace_callback( '/url\(\s*(["\']*)\s*data:\s*image\/svg\+xml(.*)\\1\s*\)/', function($m) {
     
    408409    // if tags still exist, forbid that
    409410    // the idea is taken from WP_Customize_Custom_CSS_Setting::validate as well as the translation
    410     if ( str_contains( $css, '<' ) && preg_match( '/<\/?\w+/', $css ) ) {
     411    if ( strpos( $css, '<' ) !== false && preg_match( '/<\/?\w+/', $css ) ) {
    411412        $errors['tags'] = 'HTML ' . __( 'Markup is not allowed in CSS.' );
    412413    }
     
    714715// ++get the list of css to unload with jQuery.html() && regexp, or ?query in url to print loaded scripts
    715716// ++!!??add small textarea to every public post along with css like for a unique background-image in hero
     717// ++limit meta boxes to admins too!!!
     718// ++load in footer - the last argument in enqueue script
  • fcp-first-screen-css/trunk/first-screen.php

    r2831794 r2845082  
    8686    add_action( 'wp_enqueue_scripts', $deregister_styles, 100000 );
    8787    add_action( 'wp_footer', $deregister_styles, 1 );
     88    add_action( 'wp_footer', $deregister_styles, 11 );
    8889
    8990
     
    392393
    393394    // try to escape tags inside svg with url-encoding
    394     if ( str_contains( $css, '<' ) && preg_match( '/<\/?\w+/', $css ) ) {
     395    if ( strpos( $css, '<' ) !== false && preg_match( '/<\/?\w+/', $css ) ) {
    395396        // the idea is taken from https://github.com/yoksel/url-encoder/
    396397        $svg_sanitized = preg_replace_callback( '/url\(\s*(["\']*)\s*data:\s*image\/svg\+xml(.*)\\1\s*\)/', function($m) {
     
    408409    // if tags still exist, forbid that
    409410    // the idea is taken from WP_Customize_Custom_CSS_Setting::validate as well as the translation
    410     if ( str_contains( $css, '<' ) && preg_match( '/<\/?\w+/', $css ) ) {
     411    if ( strpos( $css, '<' ) !== false && preg_match( '/<\/?\w+/', $css ) ) {
    411412        $errors['tags'] = 'HTML ' . __( 'Markup is not allowed in CSS.' );
    412413    }
     
    714715// ++get the list of css to unload with jQuery.html() && regexp, or ?query in url to print loaded scripts
    715716// ++!!??add small textarea to every public post along with css like for a unique background-image in hero
     717// ++limit meta boxes to admins too!!!
     718// ++load in footer - the last argument in enqueue script
Note: See TracChangeset for help on using the changeset viewer.