Plugin Directory

Changeset 3340061


Ignore:
Timestamp:
08/06/2025 05:48:35 AM (8 months ago)
Author:
creativform
Message:

Update Shortcodes

Location:
cf-geoplugin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cf-geoplugin/tags/8.8.7/inc/classes/Shortcodes.php

    r3339876 r3340061  
    188188    */
    189189    public function cfgeo_escape_shortcode($attr, $content = '', $tag = 'escape_shortcode')
    190     {
    191         $cache = CFGP_U::is_attribute_exists('cache', $attr);
    192 
    193         if (CFGP_Options::get('enable_cache', 0)) {
    194             $cache = true;
    195         }
    196 
    197         if (CFGP_U::is_attribute_exists('no_cache', $attr)) {
    198             $cache = false;
    199         }
    200 
    201         if (is_admin()) {
    202             $cache = false;
    203         }
    204 
    205         if (!empty($content)) {
    206             $content = preg_replace('%\[(.*?)\]%i', '[$1]', $content);
    207         }
    208 
    209         return self::__cache($tag, $content, (array)$attr, $content, $cache);
    210     }
     190    {
     191        $cache = CFGP_U::is_attribute_exists('cache', $attr);
     192
     193        if (CFGP_Options::get('enable_cache', 0)) {
     194            $cache = true;
     195        }
     196
     197        if (CFGP_U::is_attribute_exists('no_cache', $attr)) {
     198            $cache = false;
     199        }
     200
     201        if (is_admin()) {
     202            $cache = false;
     203        }
     204
     205        if (!empty($content)) {
     206            // Simple and safe replacement of square brackets
     207            $content = str_replace(['[', ']'], ['[', ']'], $content);
     208        }
     209
     210        return self::__cache($tag, $content, (array)$attr, $content, $cache);
     211    }
    211212
    212213    /**
  • cf-geoplugin/trunk/inc/classes/Shortcodes.php

    r3270891 r3340061  
    188188    */
    189189    public function cfgeo_escape_shortcode($attr, $content = '', $tag = 'escape_shortcode')
    190     {
    191         $cache = CFGP_U::is_attribute_exists('cache', $attr);
    192 
    193         if (CFGP_Options::get('enable_cache', 0)) {
    194             $cache = true;
    195         }
    196 
    197         if (CFGP_U::is_attribute_exists('no_cache', $attr)) {
    198             $cache = false;
    199         }
    200 
    201         if (is_admin()) {
    202             $cache = false;
    203         }
    204 
    205         if (!empty($content)) {
    206             $content = preg_replace('%\[(.*?)\]%i', '[$1]', $content);
    207         }
    208 
    209         return self::__cache($tag, $content, (array)$attr, $content, $cache);
    210     }
     190    {
     191        $cache = CFGP_U::is_attribute_exists('cache', $attr);
     192
     193        if (CFGP_Options::get('enable_cache', 0)) {
     194            $cache = true;
     195        }
     196
     197        if (CFGP_U::is_attribute_exists('no_cache', $attr)) {
     198            $cache = false;
     199        }
     200
     201        if (is_admin()) {
     202            $cache = false;
     203        }
     204
     205        if (!empty($content)) {
     206            // Simple and safe replacement of square brackets
     207            $content = str_replace(['[', ']'], ['[', ']'], $content);
     208        }
     209
     210        return self::__cache($tag, $content, (array)$attr, $content, $cache);
     211    }
    211212
    212213    /**
Note: See TracChangeset for help on using the changeset viewer.