File tree Expand file tree Collapse file tree 3 files changed +9
-12
lines changed Expand file tree Collapse file tree 3 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -52,10 +52,9 @@ function test_table() {
5252 );
5353
5454 $ renderer = $ this ->render ($ input );
55- $ json = new JSON (JSON_LOOSE_TYPE );
5655
57- $ this ->assertEquals ($ data , $ json -> decode ($ renderer ->getDataJSON ()));
58- $ this ->assertEquals ($ meta , $ json -> decode ($ renderer ->getMetaJSON ()));
56+ $ this ->assertEquals ($ data , json_decode ($ renderer ->getDataJSON (), true ));
57+ $ this ->assertEquals ($ meta , json_decode ($ renderer ->getMetaJSON (), true ));
5958 }
6059
6160
Original file line number Diff line number Diff line change @@ -122,14 +122,14 @@ public function editform(Doku_Event $event)
122122 *
123123 * @author Andreas Gohr <gohr@cosmocode,de>
124124 */
125- public function handle_table_post ($ event ) {
125+ public function handle_table_post (Doku_Event $ event )
126+ {
126127 global $ TEXT ;
127128 global $ INPUT ;
128- if (!$ INPUT ->post ->has ('edittable_data ' )) return ;
129+ if (!$ INPUT ->post ->has ('edittable_data ' )) return ;
129130
130- $ json = new JSON (JSON_LOOSE_TYPE );
131- $ data = $ json ->decode ($ INPUT ->post ->str ('edittable_data ' ));
132- $ meta = $ json ->decode ($ INPUT ->post ->str ('edittable_meta ' ));
131+ $ data = json_decode ($ INPUT ->post ->str ('edittable_data ' ), true );
132+ $ meta = json_decode ($ INPUT ->post ->str ('edittable_meta ' ), true );
133133
134134 $ TEXT = $ this ->build_table ($ data , $ meta );
135135 }
Original file line number Diff line number Diff line change @@ -35,8 +35,7 @@ class renderer_plugin_edittable_json extends renderer_plugin_edittable_inverse {
3535 * @return array
3636 */
3737 public function getDataJSON () {
38- $ json = new JSON ();
39- return $ json ->encode ($ this ->tdata );
38+ return json_encode ($ this ->tdata );
4039 }
4140
4241 /**
@@ -45,8 +44,7 @@ public function getDataJSON() {
4544 * @return array
4645 */
4746 public function getMetaJSON () {
48- $ json = new JSON ();
49- return $ json ->encode ($ this ->tmeta );
47+ return json_encode ($ this ->tmeta );
5048 }
5149
5250 // renderer functions below
You can’t perform that action at this time.
0 commit comments