Plugin Directory

Changeset 3242283


Ignore:
Timestamp:
02/18/2025 01:57:43 AM (14 months ago)
Author:
gal_op
Message:

Security patch and readme.txt changes

Location:
wp-responsive-slab-text/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-responsive-slab-text/trunk/README.txt

    r3242233 r3242283  
    22Contributors:gal_op
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2Z366DM56DLHS
    4 Tags: Fit text, slab text, responsive, shortcode, justify text, slabtext, auto fit text, auto resize text, text resize
     4Tags: text resize, responsive text, typography, auto fit text, slabtext
    55Requires at least: 2.5
    66Tested up to: 6.7.3
  • wp-responsive-slab-text/trunk/wp-responsive-fit-text.php

    r3242233 r3242283  
    6666add_shortcode( 'slab', 'slabtextline_shortcode' );
    6767
    68 // Footer script to handle JavaScript execution securely
     68// Secure JavaScript execution
    6969add_action('wp_footer', function() {
    70     if (!empty($GLOBALS["SC_SCRIPTS"])) {
    71         // Escape output using wp_json_encode() to prevent XSS
    72         echo '<script type="text/javascript">var slabTextData = ' . wp_json_encode($GLOBALS["SC_SCRIPTS"]) . '; eval(slabTextData);</script>';
    73     }
     70    if (!empty($GLOBALS["SC_SCRIPTS"])) {
     71        echo '<script type="text/javascript">';
     72        echo 'let slabTextData = ' . wp_json_encode($GLOBALS["SC_SCRIPTS"]) . ';';
     73        echo 'if (slabTextData) { try { (new Function(slabTextData))(); } catch (e) { console.error("Error executing slabTextData:", e); } }';
     74        echo '</script>';
     75    }
    7476}, 100);
     77
    7578?>
Note: See TracChangeset for help on using the changeset viewer.