@@ -79,7 +79,7 @@ function gist_filter_filter_tips($filter, $format, $long = FALSE) {
7979function theme_gist_filter_code($vars) {
8080 $file = $vars['file'];
8181
82- return '<div class="drupal-gist-file"><pre type="' . strtolower ($file['language']) . '">' . check_plain($file['content']) . '</pre></div>';
82+ return '<div class="drupal-gist-file"><pre type="' . drupal_strtolower ($file['language']) . '">' . check_plain($file['content']) . '</pre></div>';
8383}
8484
8585/**
@@ -119,7 +119,6 @@ function _gist_display_embed($matches) {
119119 $gist_url = isset($matches[2]) && !empty($matches[2]) ? $gist_url . '.js?file=' . $matches[2] : $gist_url . '.js';
120120
121121 // Also grab the content and display it in code tags (in case the user does not have JS).
122- // TODO: 1. there is some caching going on here. 2. this is expensive.
123122 $output = '<noscript>' . _gist_display_code($matches) . '</noscript>';
124123
125124 $output .= '<script src="' . $gist_url . '"></script>';
@@ -153,7 +152,7 @@ function gist_filter_get_gist($id) {
153152 $cid = 'gist_filter:gist:' . $id;
154153 // Check if this gist is already in the cache
155154 $gist = cache_get($cid);
156-
155+
157156 if ($cached = cache_get($cid)) {
158157 $gist = $cached->data;
159158 }
@@ -162,7 +161,7 @@ function gist_filter_get_gist($id) {
162161 $url = 'https://api.github.com/gists/' . $id;
163162 $response = drupal_http_request($url, array('headers' => array('Content-Type' => 'application/json')));
164163 $gist = drupal_json_decode($response->data);
165-
164+
166165 // Cache the gist until the next cache flush
167166 cache_set($cid, $gist, 'cache', CACHE_TEMPORARY);
168167 }
0 commit comments