| @@ -47,14 +47,12 @@ | ||
| 47 | 47 | * @access public |
| 48 | 48 | * @return string The serialized array of data. |
| 49 | 49 | */ |
| 50 | 50 | public function getData() { |
| 51 | - return serialize( | |
| 52 | - array( | |
| 53 | - 'source' => $this->_filename, | |
| 54 | - 'data' => $this->_data, | |
| 55 | - ) | |
| 56 | - ); | |
| 51 | + return serialize( array( | |
| 52 | + 'source' => $this->_filename, | |
| 53 | + 'data' => $this->_data, | |
| 54 | + ) ); | |
| 57 | 55 | } |
| 58 | 56 | |
| 59 | 57 | /** |
| 60 | 58 | * Re populates data and series. |
| @@ -73,9 +71,9 @@ | ||
| 73 | 71 | |
| 74 | 72 | // if filename is empty, extract it from chart content |
| 75 | 73 | if ( empty( $this->_filename ) ) { |
| 76 | 74 | $chart = get_post( $chart_id ); |
| 77 | - $data = unserialize( html_entity_decode( $chart->post_content ) ); | |
| 75 | + $data = unserialize( $chart->post_content ); | |
| 78 | 76 | if ( ! isset( $data['source'] ) ) { |
| 79 | 77 | return false; |
| 80 | 78 | } |
| 81 | 79 | |
| @@ -96,9 +94,9 @@ | ||
| 96 | 94 | * @param int $chart_id The chart id. |
| 97 | 95 | * @return array The re populated array of data or old one. |
| 98 | 96 | */ |
| 99 | 97 | public function repopulateData( $data, $chart_id ) { |
| 100 | - return array_key_exists( 'data', $data ) ? $data['data'] : $data; | |
| 98 | + return $this->_repopulate( $chart_id ) ? $this->_data : $data; | |
| 101 | 99 | } |
| 102 | 100 | |
| 103 | 101 | /** |
| 104 | 102 | * Re populates series. |
| @@ -110,9 +108,9 @@ | ||
| 110 | 108 | * @param int $chart_id The chart id. |
| 111 | 109 | * @return array The re populated array of series or old one. |
| 112 | 110 | */ |
| 113 | 111 | public function repopulateSeries( $series, $chart_id ) { |
| 114 | - return $series; | |
| 112 | + return $this->_repopulate( $chart_id ) ? $this->_series : $series; | |
| 115 | 113 | } |
| 116 | 114 | |
| 117 | 115 | /** |
| 118 | 116 | * Returns source name. |
| @@ -138,9 +136,9 @@ | ||
| 138 | 136 | */ |
| 139 | 137 | protected function _get_file_handle( $filename = false ) { |
| 140 | 138 | static $allow_url_fopen = null; |
| 141 | 139 | |
| 142 | - if ( ! is_wp_error( $this->_tmpfile ) && $this->_tmpfile && is_readable( $this->_tmpfile ) ) { | |
| 140 | + if ( $this->_tmpfile && is_readable( $this->_tmpfile ) ) { | |
| 143 | 141 | return parent::_get_file_handle( $this->_tmpfile ); |
| 144 | 142 | } |
| 145 | 143 | |
| 146 | 144 | if ( is_null( $allow_url_fopen ) ) { |