Changeset 2473673
- Timestamp:
- 02/12/2021 11:24:39 AM (5 years ago)
- Location:
- squirrly-seo/trunk
- Files:
-
- 4 edited
-
classes/helpers/Sanitize.php (modified) (1 diff)
-
controllers/PostsList.php (modified) (4 diffs)
-
view/Research/Research.php (modified) (1 diff)
-
view/Research/ResearchDetails.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
squirrly-seo/trunk/classes/helpers/Sanitize.php
r2404507 r2473673 62 62 public static function clearKeywords($keywords) { 63 63 return self::clearTitle($keywords); 64 }65 66 /**67 * Escape the keyword for tags and urls68 * @param $str69 * @return string70 */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 urls79 * @param $str80 * @return string81 */82 public static function escapeHtml($str) {83 $str = esc_attr($str);84 85 return $str;86 64 } 87 65 -
squirrly-seo/trunk/controllers/PostsList.php
r2453886 r2473673 90 90 91 91 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 } 95 103 } else { 96 104 if (get_post_status($post_id) == 'publish') … … 98 106 } 99 107 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>'; 101 109 } 102 110 … … 127 135 */ 128 136 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) { 130 138 $term = get_term($tax_id); 131 139 … … 198 206 if (is_wp_error($json)) { 199 207 $array = array(); 200 if ($json->get_error_message() == 'no_data') {208 if ($json->get_error_message() == 'no_data') { 201 209 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_); 203 211 } 204 } elseif($json->get_error_message() == 'maintenance') {212 } elseif ($json->get_error_message() == 'maintenance') { 205 213 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 />'); 207 215 } 208 216 } -
squirrly-seo/trunk/view/Research/Research.php
r2473303 r2473673 88 88 if (isset($view->countries) && !empty($view->countries)) { 89 89 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>'; 91 91 } 92 92 } -
squirrly-seo/trunk/view/Research/ResearchDetails.php
r2473303 r2473673 3 3 //For teh saved country 4 4 if (isset($_COOKIE['sq_country'])) { 5 $view->country = $_COOKIE['sq_country'];5 $view->country = sanitize_text_field($_COOKIE['sq_country']); 6 6 } 7 7
Note: See TracChangeset
for help on using the changeset viewer.