File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -197,9 +197,10 @@ function template_preprocess_ding_panels_library_user_staff_title(&$variables) {
197
197
* Utitlity function for caching remote images locally for 24 hours.
198
198
*
199
199
* @param $path the path to the image
200
+ * @param $image_type the filetype of the saved image
200
201
* @return string the local path for the image
201
202
*/
202
- function _ding_panels_get_image($path) {
203
+ function _ding_panels_get_image($path, $image_type = '.png' ) {
203
204
$return = $path;
204
205
205
206
$base_path = file_directory_path().'/ding_panels';
@@ -208,7 +209,7 @@ function _ding_panels_get_image($path) {
208
209
$cut_path = str_ireplace("http://", "", $path);
209
210
$image_name = preg_replace("/[^\w]/", "-", $path);
210
211
211
- $image_path = $base_path. "/". $image_name . '.png' ;
212
+ $image_path = $base_path . "/" . $image_name . $image_type ;
212
213
if (file_exists($image_path) &&
213
214
time() < (filectime($image_path) + (60*60*24))) {
214
215
// File already downloaded and within 24 hours cache lifetime
You can’t perform that action at this time.
0 commit comments