Plugin Directory

Changeset 2473673


Ignore:
Timestamp:
02/12/2021 11:24:39 AM (5 years ago)
Author:
cifi
Message:

Load the optimization column in Post Lists when Quick Edit is used
Sanitize all Cookies

Location:
squirrly-seo/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • squirrly-seo/trunk/classes/helpers/Sanitize.php

    r2404507 r2473673  
    6262    public static function clearKeywords($keywords) {
    6363        return self::clearTitle($keywords);
    64     }
    65 
    66     /**
    67      * Escape the keyword for tags and urls
    68      * @param $str
    69      * @return string
    70      */
    71     public static function escapeAttr($str) {
    72         $str = esc_attr($str);
    73 
    74         return $str;
    75     }
    76 
    77     /**
    78      * Escape the keyword for tags and urls
    79      * @param $str
    80      * @return string
    81      */
    82     public static function escapeHtml($str) {
    83         $str = esc_attr($str);
    84 
    85         return $str;
    8664    }
    8765
  • squirrly-seo/trunk/controllers/PostsList.php

    r2453886 r2473673  
    9090
    9191        if ($column == $this->_slacolumn_id) {
    92             $cached = false;
    93             if (isset($_COOKIE[$this->_slacolumn_id . $post_id]) && $_COOKIE[$this->_slacolumn_id . $post_id] <> '') {
    94                 $cached = true;
     92            $html = false;
     93            if (SQ_Classes_Helpers_Tools::isAjax()) {
     94                $args = array();
     95                $args['posts'] = $post_id;
     96
     97                if ($json = SQ_Classes_RemoteController::getPostOptimization($args)) {
     98                    if (!is_wp_error($json)) {
     99                        $posts = $this->model->processPost($json, $post_type);
     100                        $html = $posts[$post_id];
     101                    }
     102                }
    95103            } else {
    96104                if (get_post_status($post_id) == 'publish')
     
    98106            }
    99107
    100             echo '<div class="' . $this->_slacolumn_id . '_row" ref="' . $post_id . '">' . (($cached) ? $_COOKIE[$this->_slacolumn_id . $post_id] : 'loading ...') . '</div>';
     108            echo '<div class="' . $this->_slacolumn_id . '_row" ref="' . $post_id . '">' . (($html) ? $html: 'loading ...') . '</div>';
    101109        }
    102110
     
    127135     */
    128136    public function add_tax_row($html = '', $column = 0, $tax_id = 0) {
    129         if((int)$tax_id > 0 && (int)$column > 0 ) {
     137        if ((int)$tax_id > 0 && (int)$column > 0) {
    130138            $term = get_term($tax_id);
    131139
     
    198206                        if (is_wp_error($json)) {
    199207                            $array = array();
    200                             if($json->get_error_message() == 'no_data') {
     208                            if ($json->get_error_message() == 'no_data') {
    201209                                foreach ($posts as $post_id) {
    202                                     $array[$post_id] = esc_html__("Network Error. Please Refresh.",_SQ_PLUGIN_NAME_);
     210                                    $array[$post_id] = esc_html__("Network Error. Please Refresh.", _SQ_PLUGIN_NAME_);
    203211                                }
    204                             }elseif($json->get_error_message() == 'maintenance') {
     212                            } elseif ($json->get_error_message() == 'maintenance') {
    205213                                foreach ($posts as $post_id) {
    206                                     $array[$post_id] = sprintf(esc_html__("Maintenance. %sWe'll be back in a minute.",_SQ_PLUGIN_NAME_),'<br />');
     214                                    $array[$post_id] = sprintf(esc_html__("Maintenance. %sWe'll be back in a minute.", _SQ_PLUGIN_NAME_), '<br />');
    207215                                }
    208216                            }
  • squirrly-seo/trunk/view/Research/Research.php

    r2473303 r2473673  
    8888                                        if (isset($view->countries) && !empty($view->countries)) {
    8989                                            foreach ($view->countries as $key => $country) {
    90                                                 echo '<option value="' . $key . '" ' . (isset($_COOKIE['sq_country']) && $_COOKIE['sq_country'] == $key ? 'selected="selected"' : '') . '>' . $country . '</option>';
     90                                                echo '<option value="' . $key . '" ' . (isset($_COOKIE['sq_country']) && sanitize_text_field($_COOKIE['sq_country']) == $key ? 'selected="selected"' : '') . '>' . $country . '</option>';
    9191                                            }
    9292                                        }
  • squirrly-seo/trunk/view/Research/ResearchDetails.php

    r2473303 r2473673  
    33    //For teh saved country
    44    if (isset($_COOKIE['sq_country'])) {
    5         $view->country = $_COOKIE['sq_country'];
     5        $view->country = sanitize_text_field($_COOKIE['sq_country']);
    66    }
    77
Note: See TracChangeset for help on using the changeset viewer.