Changeset 3242283
- Timestamp:
- 02/18/2025 01:57:43 AM (14 months ago)
- Location:
- wp-responsive-slab-text/trunk
- Files:
-
- 2 edited
-
README.txt (modified) (1 diff)
-
wp-responsive-fit-text.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-responsive-slab-text/trunk/README.txt
r3242233 r3242283 2 2 Contributors:gal_op 3 3 Donate 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 resize4 Tags: text resize, responsive text, typography, auto fit text, slabtext 5 5 Requires at least: 2.5 6 6 Tested up to: 6.7.3 -
wp-responsive-slab-text/trunk/wp-responsive-fit-text.php
r3242233 r3242283 66 66 add_shortcode( 'slab', 'slabtextline_shortcode' ); 67 67 68 // Footer script to handle JavaScript execution securely68 // Secure JavaScript execution 69 69 add_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 } 74 76 }, 100); 77 75 78 ?>
Note: See TracChangeset
for help on using the changeset viewer.