Changeset 2845082
- Timestamp:
- 01/08/2023 10:57:55 AM (2 years ago)
- Location:
- fcp-first-screen-css
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fcp-first-screen-css/tags/1.2/first-screen.php
r2831794 r2845082 86 86 add_action( 'wp_enqueue_scripts', $deregister_styles, 100000 ); 87 87 add_action( 'wp_footer', $deregister_styles, 1 ); 88 add_action( 'wp_footer', $deregister_styles, 11 ); 88 89 89 90 … … 392 393 393 394 // 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 ) ) { 395 396 // the idea is taken from https://github.com/yoksel/url-encoder/ 396 397 $svg_sanitized = preg_replace_callback( '/url\(\s*(["\']*)\s*data:\s*image\/svg\+xml(.*)\\1\s*\)/', function($m) { … … 408 409 // if tags still exist, forbid that 409 410 // 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 ) ) { 411 412 $errors['tags'] = 'HTML ' . __( 'Markup is not allowed in CSS.' ); 412 413 } … … 714 715 // ++get the list of css to unload with jQuery.html() && regexp, or ?query in url to print loaded scripts 715 716 // ++!!??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 86 86 add_action( 'wp_enqueue_scripts', $deregister_styles, 100000 ); 87 87 add_action( 'wp_footer', $deregister_styles, 1 ); 88 add_action( 'wp_footer', $deregister_styles, 11 ); 88 89 89 90 … … 392 393 393 394 // 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 ) ) { 395 396 // the idea is taken from https://github.com/yoksel/url-encoder/ 396 397 $svg_sanitized = preg_replace_callback( '/url\(\s*(["\']*)\s*data:\s*image\/svg\+xml(.*)\\1\s*\)/', function($m) { … … 408 409 // if tags still exist, forbid that 409 410 // 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 ) ) { 411 412 $errors['tags'] = 'HTML ' . __( 'Markup is not allowed in CSS.' ); 412 413 } … … 714 715 // ++get the list of css to unload with jQuery.html() && regexp, or ?query in url to print loaded scripts 715 716 // ++!!??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.