PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.7.1
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.7.1
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | classes/Visualizer/Module.php +19 -7 3.7.03.7.1 View file →
@@ -739,18 +739,30 @@
739 739 * Gets the chart content after common manipulations.
740 740 */
741 741 public static function get_chart_data( $chart, $type, $run_filter = true ) {
742 742 // change HTML entities
743 - $data = unserialize( html_entity_decode( htmlentities( $chart->post_content ) ) );
743 + $post_content = html_entity_decode( htmlentities( $chart->post_content ) );
744 + $post_content = preg_replace_callback(
745 + '!s:(\d+):"(.*?)";!s',
746 + function ( $matches ) {
747 + if ( isset( $matches[2] ) ) {
748 + return 's:' . strlen( $matches[2] ) . ':"' . $matches[2] . '";';
749 + }
750 + },
751 + $post_content
752 + );
753 + $data = unserialize( $post_content );
744 754 $altered = array();
745 - foreach ( $data as $index => $array ) {
746 - if ( ! is_array( $index ) && is_array( $array ) ) {
747 - foreach ( $array as &$datum ) {
748 - if ( is_string( $datum ) ) {
749 - $datum = stripslashes( $datum );
755 + if ( ! empty( $data ) ) {
756 + foreach ( $data as $index => $array ) {
757 + if ( ! is_array( $index ) && is_array( $array ) ) {
758 + foreach ( $array as &$datum ) {
759 + if ( is_string( $datum ) ) {
760 + $datum = stripslashes( $datum );
761 + }
750 762 }
763 + $altered[ $index ] = $array;
751 764 }
752 - $altered[ $index ] = $array;
753 765 }
754 766 }
755 767 // if something goes wrong and the end result is empty, be safe and use the original data
756 768 if ( empty( $altered ) ) {