Skip to content

Commit 238a555

Browse files
committed
use drupal_json_encode() directly
1 parent b84631e commit 238a555

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

flot.module

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ function theme_flot_graph($variables) {
6767
$id = str_replace('-', '_', $element['id']);
6868

6969
if ($loader) {
70-
$json_data = function_exists('json_encode') ? json_encode($data) : drupal_json_encode($data);
70+
$json_data = drupal_json_encode($data);
7171
$extra = "Drupal.flot.{$id}_data = {$json_data}; {$loader}";
7272
$data = array();
7373
}
7474

75-
$json_data = function_exists('json_encode') ? json_encode($data) : drupal_json_encode($data);
76-
$json_options = function_exists('json_encode') ? json_encode($options) : drupal_json_encode($options);
75+
$json_data = drupal_json_encode($data);
76+
$json_options = drupal_json_encode($options);
7777
$data = "(function ($) {
7878
$(document).ready(function() {
7979
Drupal.flot.{$id} = $.plot($('#{$element['id']}'), {$json_data}, {$json_options});

0 commit comments

Comments
 (0)