Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/xagio-seo/inc/xagio_export.php
+++ b/xagio-seo/inc/xagio_export.php
@@ -85,7 +85,7 @@
$out = self::uploads($cursor, $limit);
break;
case 'prepare':
- $out = ['item' => self::prepare()];
+ $out = ['item' => self::prepareSite()];
break;
case 'crawl_pass':
$out = ['item' => self::crawlPass((string) $request->get_param('job'), (int) $request->get_param('ttl'))];
@@ -1283,7 +1283,7 @@
* prepare: fresh, consistent builder CSS and empty page caches before the crawl
* ============================================================================================== */
- private static function prepare()
+ private static function prepareSite()
{
$done = ['elementor_css' => null, 'divi_cache' => null, 'page_caches' => []];
--- a/xagio-seo/modules/aisettings/models/xagio_llms.php
+++ b/xagio-seo/modules/aisettings/models/xagio_llms.php
@@ -256,6 +256,8 @@
$posts = get_posts([
'post_type' => $post_type,
'post_status' => 'publish',
+ // Password-protected posts are not public, so they are left out
+ 'has_password' => false,
'posts_per_page' => $max_items,
'orderby' => 'menu_order title',
'order' => 'ASC',
--- a/xagio-seo/modules/aisettings/models/xagio_okf.php
+++ b/xagio-seo/modules/aisettings/models/xagio_okf.php
@@ -31,6 +31,10 @@
// Hard ceiling: the whole bundle lives in one wp_option row.
const MAX_POSTS = 1000;
+ // Bump to drop bundles built by older versions (v2: password-protected posts left out)
+ const OPTION_BUNDLE_VERSION = 'XAGIO_OKF_BUNDLE_VERSION';
+ const BUNDLE_VERSION = 2;
+
public static function initialize()
{
add_action('init', ['XAGIO_MODEL_OKF', 'addRewrite']);
@@ -39,6 +43,13 @@
// Build-on-change: flag on content edits, rebuild once on shutdown (mirrors sitemaps).
if (get_option(self::OPTION_ENABLED) === '1') {
+ // A bundle from an older version may hold content that is no longer served: drop it so it is rebuilt
+ if ((int) get_option(self::OPTION_BUNDLE_VERSION) !== self::BUNDLE_VERSION) {
+ delete_option(self::OPTION_BUNDLE);
+ update_option(self::OPTION_NEEDS_REBUILD, 1, false);
+ update_option(self::OPTION_BUNDLE_VERSION, self::BUNDLE_VERSION);
+ }
+
add_action('save_post', ['XAGIO_MODEL_OKF', 'onSavePostInvalidate'], 20, 3);
add_action('transition_post_status', ['XAGIO_MODEL_OKF', 'onTransitionInvalidate'], 10, 3);
add_action('trashed_post', ['XAGIO_MODEL_OKF', 'invalidate']);
@@ -761,6 +772,8 @@
$posts = get_posts([
'post_type' => $types,
'post_status' => 'publish',
+ // Password-protected posts are not public, so their content must not be served
+ 'has_password' => false,
'posts_per_page' => self::MAX_POSTS,
'orderby' => 'date',
'order' => 'DESC',
--- a/xagio-seo/modules/nichehunter/models/xagio_nichehunter.php
+++ b/xagio-seo/modules/nichehunter/models/xagio_nichehunter.php
@@ -195,7 +195,7 @@
if(is_array($xagio_output)) {
foreach ($xagio_output as $o) {
if (!is_array($o)) continue;
- $o['filters'] = unserialize($o['filters']);
+ $o['filters'] = is_string($o['filters']) ? @unserialize($o['filters'], ['allowed_classes' => FALSE]) : $o['filters'];
$OUT[] = $o;
}
}
--- a/xagio-seo/modules/projectplanner/models/xagio_projects.php
+++ b/xagio-seo/modules/projectplanner/models/xagio_projects.php
@@ -655,42 +655,39 @@
$group_id = $wpdb->insert_id;
- $likeKeywords = [];
+ $likeValues = [];
foreach ($keywords as $keyword) {
- $keyword = '%' . $wpdb->esc_like(trim($keyword)) . '%';
- $likeKeywords[] = $wpdb->prepare("keyword LIKE %s", $keyword);
+ $keyword = trim($keyword);
+ if ($keyword === '') {
+ continue;
+ }
+ $likeValues[] = '%' . $wpdb->esc_like($keyword) . '%';
}
unset($keywords);
- $likeKeywords = implode(" OR ", $likeKeywords);
- $likeKeywords = "($likeKeywords)";
-
- // Create placeholders for project group IDs
- $groupIdsPlaceholders = implode(", ", array_fill(0, count($project_group_ids), '%d'));
-
- // Merge group IDs with likeKeywords into a single array
- $queryParams = array_merge(array_map('absint', $project_group_ids), [sanitize_text_field($likeKeywords)]);
-
- // Prepare and execute the query
- $updateKeywords = $wpdb->get_results(
- $wpdb->prepare(
- "SELECT id FROM xag_keywords WHERE group_id IN ($groupIdsPlaceholders) AND %s", ...$queryParams
- ), ARRAY_A
- );
-
- unset($likeKeywords);
-
$keywordIDs = [];
- foreach ($updateKeywords as $uk) {
- $keywordIDs[] = $uk['id'];
+ if (!empty($project_group_ids) && !empty($likeValues)) {
+ // One placeholder per group ID and per keyword, so the whole query goes through prepare()
+ $groupIdsPlaceholders = implode(", ", array_fill(0, count($project_group_ids), '%d'));
+ $likePlaceholders = implode(" OR ", array_fill(0, count($likeValues), 'keyword LIKE %s'));
+
+ $keywordIDs = $wpdb->get_col(
+ $wpdb->prepare(
+ "SELECT id FROM xag_keywords WHERE group_id IN ($groupIdsPlaceholders) AND ($likePlaceholders)", ...array_merge(array_map('absint', $project_group_ids), $likeValues)
+ )
+ );
}
- unset($updateKeywords);
+ unset($likeValues);
- $wpdb->update('xag_projects', [
- 'group_id' => $group_id
- ], [
- 'id' => $keywordIDs
- ]);
+ // Move the matching keywords into the new seed group
+ if (!empty($keywordIDs)) {
+ $xagio_placeholders = implode(", ", array_fill(0, count($keywordIDs), '%d'));
+ $wpdb->query(
+ $wpdb->prepare(
+ "UPDATE xag_keywords SET group_id = %d WHERE id IN ($xagio_placeholders)", $group_id, ...array_map('absint', $keywordIDs)
+ )
+ );
+ }
xagio_jsonc([
'project_id' => $project_id
--- a/xagio-seo/modules/redirects/models/xagio_log404.php
+++ b/xagio-seo/modules/redirects/models/xagio_log404.php
@@ -290,18 +290,30 @@
$slug = '';
if (isset($_SERVER['REQUEST_URI'])) {
- $slug = sanitize_url(wp_unslash($_SERVER['REQUEST_URI']));
+ $slug = self::cleanRequestUri(wp_unslash($_SERVER['REQUEST_URI']));
}
$xagio_url = $urlProtocol . '://' . $serverName . $slug;
return $xagio_url;
}
+ /**
+ * The request path as stored in the 404 log. HTML entities are decoded before sanitize_url(), so an
+ * encoded quote (", ") is stripped like a literal one instead of being stored and turned back
+ * into a quote by the browser later (Wordfence report: 404 log -> Add 301 Redirect -> stored XSS).
+ */
+ public static function cleanRequestUri($uri)
+ {
+ $uri = html_entity_decode((string) $uri, ENT_QUOTES | ENT_HTML5, 'UTF-8');
+ $uri = str_replace(['"', '<', '>', '`'], '', $uri);
+ return sanitize_url($uri);
+ }
+
public static function getCurrentSlug()
{
$slug = '';
if (isset($_SERVER['REQUEST_URI'])) {
- $slug = sanitize_url(wp_unslash($_SERVER['REQUEST_URI']));
+ $slug = self::cleanRequestUri(wp_unslash($_SERVER['REQUEST_URI']));
}
return $slug;
}
@@ -660,7 +672,7 @@
check_ajax_referer('xagio_nonce', '_xagio_nonce');
if (isset($_POST['old404URL']) && isset($_POST['newURL'])) {
- self::add404Redirect(sanitize_text_field(wp_unslash($_POST['old404URL'])), sanitize_text_field(wp_unslash($_POST['newURL'])));
+ self::add404Redirect(XAGIO_MODEL_REDIRECTS::cleanPath($_POST['old404URL']), XAGIO_MODEL_REDIRECTS::cleanPath($_POST['newURL']));
}
xagio_json('error', '404 URL not fetched! Please add this URL from 301 redirects.');
}
--- a/xagio-seo/modules/redirects/models/xagio_redirects.php
+++ b/xagio-seo/modules/redirects/models/xagio_redirects.php
@@ -99,6 +99,18 @@
}
+ /**
+ * A redirect path or URL from the admin screens: plain text, HTML entities decoded and then the
+ * characters that could end a double-quoted HTML attribute or open a tag removed (" < > `). A path never needs
+ * them; a value logged from a 404 could otherwise bring an encoded quote back as a real one.
+ */
+ public static function cleanPath($raw)
+ {
+ $v = sanitize_text_field(wp_unslash((string) $raw));
+ $v = html_entity_decode($v, ENT_QUOTES | ENT_HTML5, 'UTF-8');
+ return trim(str_replace(['"', '<', '>', '`'], '', $v));
+ }
+
public static function addRedirect()
{
check_ajax_referer('xagio_nonce', '_xagio_nonce');
@@ -107,8 +119,8 @@
wp_die('Required parameters are missing.', 'Missing Parameters', ['response' => 400]);
}
- $oldURL = sanitize_text_field(wp_unslash($_POST['oldURL']));
- $newURL = sanitize_text_field(wp_unslash($_POST['newURL']));
+ $oldURL = self::cleanPath($_POST['oldURL']);
+ $newURL = self::cleanPath($_POST['newURL']);
self::add($oldURL, $newURL);
}
@@ -124,8 +136,8 @@
}
$id = intval($_POST['id']);
- $oldURL = sanitize_text_field(wp_unslash($_POST['oldURL']));
- $newURL = sanitize_text_field(wp_unslash($_POST['newURL']));
+ $oldURL = self::cleanPath($_POST['oldURL']);
+ $newURL = self::cleanPath($_POST['newURL']);
$oldURL = trim($oldURL, '/');
$newURL = trim($newURL, '/');
--- a/xagio-seo/modules/reviews/metabox/display_reviews.php
+++ b/xagio-seo/modules/reviews/metabox/display_reviews.php
@@ -95,17 +95,18 @@
$xagio_date = gmdate('d, M Y', strtotime($xagio_r['date']));
// Stars
- $xagio_full_stars = $xagio_r['rating'];
- $xagio_empty_stars = 5 - $xagio_r['rating'];
+ $xagio_full_stars = max(0, min(5, intval($xagio_r['rating'])));
+ $xagio_empty_stars = 5 - $xagio_full_stars;
// Review Author
$xagio_name = '';
- if (!empty($xagio_r['name'])) $xagio_name = '<b>' . stripslashes($xagio_r['name']) . '</b> <br>';
- if (!empty($xagio_r['website'])) $xagio_name = '<a href="' . $xagio_r['website'] . '" target="_blank">' . $xagio_name . '</a>';
- if (!empty($xagio_r['age'])) $xagio_name .= $xagio_r['age'];
- if (!empty($xagio_r['location'])) $xagio_name .= ' from ' . $xagio_r['location'];
- if (!empty($xagio_r['email'])) $xagio_name .= ' (<a style="color: blue;" href="mailto:' . $xagio_r['email'] . '" target="_blank"><i class="xagio-icon xagio-icon-at"></i></a>)';
- if (!empty($xagio_r['telephone'])) $xagio_name .= ' (<a style="color: blue;" href="tel:' . $xagio_r['telephone'] . '" target="_blank"><i class="xagio-icon xagio-icon-phone"></i></a>)';
+ // Every field comes from a public form, so each one is escaped for the spot it lands in
+ if (!empty($xagio_r['name'])) $xagio_name = '<b>' . esc_html(stripslashes($xagio_r['name'])) . '</b> <br>';
+ if (!empty($xagio_r['website'])) $xagio_name = '<a href="' . esc_url($xagio_r['website']) . '" target="_blank" rel="nofollow noopener">' . $xagio_name . '</a>';
+ if (!empty($xagio_r['age'])) $xagio_name .= esc_html(intval($xagio_r['age']));
+ if (!empty($xagio_r['location'])) $xagio_name .= ' from ' . esc_html(stripslashes($xagio_r['location']));
+ if (!empty($xagio_r['email'])) $xagio_name .= ' (<a style="color: blue;" href="' . esc_url('mailto:' . sanitize_email($xagio_r['email'])) . '" target="_blank"><i class="xagio-icon xagio-icon-at"></i></a>)';
+ if (!empty($xagio_r['telephone'])) $xagio_name .= ' (<a style="color: blue;" href="' . esc_attr('tel:' . preg_replace('/[^0-9+]/', '', $xagio_r['telephone'])) . '" target="_blank"><i class="xagio-icon xagio-icon-phone"></i></a>)';
// Limit Reviews
$xagio_limit_class = '';
@@ -146,7 +147,7 @@
<div class="prs-review-body"><?php echo esc_html(stripslashes($xagio_r['review'])); ?></div>
<?php } ?>
- <div class="prs-review-author"><?php echo wp_kses_post(stripslashes($xagio_name)); ?></div>
+ <div class="prs-review-author"><?php echo wp_kses_post($xagio_name); ?></div>
</div>
--- a/xagio-seo/modules/reviews/models/xagio_reviews.php
+++ b/xagio-seo/modules/reviews/models/xagio_reviews.php
@@ -989,7 +989,7 @@
'name' => isset($_POST['name']) ? sanitize_text_field(wp_unslash($_POST['name'])) : 'n/a',
'review' => isset($_POST['review']) ? sanitize_text_field(wp_unslash($_POST['review'])) : 'n/a',
'title' => isset($_POST['title']) ? sanitize_text_field(wp_unslash($_POST['title'])) : 'n/a',
- 'rating' => isset($_POST['rating']) ? intval($_POST['rating']) : 5,
+ 'rating' => isset($_POST['rating']) ? max(1, min(5, intval($_POST['rating']))) : 5,
'email' => isset($_POST['email']) ? sanitize_email(wp_unslash($_POST['email'])) : 'n/a',
'website' => isset($_POST['website']) ? sanitize_url(wp_unslash($_POST['website'])) : 'n/a',
'telephone' => isset($_POST['telephone']) ? sanitize_text_field(wp_unslash($_POST['telephone'])) : 'n/a',
--- a/xagio-seo/modules/seo/models/xagio_seo.php
+++ b/xagio-seo/modules/seo/models/xagio_seo.php
@@ -43,6 +43,12 @@
'saveSeoSearch'
]);
+ // Xagio's post meta is written by the plugin only, never through core Custom Fields / REST / XML-RPC
+ add_filter('is_protected_meta', [
+ 'XAGIO_MODEL_SEO',
+ 'protectMeta'
+ ], 10, 3);
+
add_filter('post_row_actions', [
'XAGIO_MODEL_SEO',
'duplicatePostButton'
@@ -515,6 +521,10 @@
$post_id = abs(intval($_POST['post_id']));
$status = abs(intval($_POST['status']));
+ if (!current_user_can('edit_post', $post_id)) {
+ wp_die('You are not allowed to edit this post.', 'Forbidden', ['response' => 403]);
+ }
+
update_post_meta($post_id, 'XAGIO_SEO', $status);
}
@@ -661,6 +671,51 @@
}
}
+ /** What a page's own header / body / footer scripts may contain: script tags only (also enforced on output). */
+ public static function scriptAllowedTags()
+ {
+ return [
+ 'script' => [
+ 'src' => true,
+ 'type' => true,
+ 'async' => true,
+ 'defer' => true,
+ 'crossorigin' => true,
+ 'integrity' => true,
+ 'nomodule' => true,
+ 'charset' => true,
+ 'referrerpolicy' => true,
+ 'id' => true,
+ 'class' => true,
+ 'data-*' => true
+ ]
+ ];
+ }
+
+ /**
+ * A page's own scripts (XAGIO_SEO_SCRIPTS_HEADER / _BODY / _FOOTER) as they may be printed: through the same
+ * script-only allow-list savePost() applies, so a value written some other way (core Custom Fields before
+ * these keys were protected) cannot add other tags or event handlers. Returned slashed like the stored value,
+ * because the caller runs stripslashes_deep() on the whole block.
+ */
+ public static function postScripts($post_id, $key)
+ {
+ $value = get_post_meta($post_id, $key, TRUE);
+ if (!is_string($value) || $value === '') {
+ return '';
+ }
+ return addslashes(wp_kses(stripslashes($value), self::scriptAllowedTags()));
+ }
+
+ /** is_protected_meta: Xagio's post meta (XAGIO_*, the legacy ps_seo_*) can only be written by the plugin itself. */
+ public static function protectMeta($protected, $meta_key, $meta_type)
+ {
+ if ($meta_type === 'post' && is_string($meta_key) && (strpos($meta_key, 'XAGIO_') === 0 || strpos($meta_key, 'ps_seo_') === 0)) {
+ return true;
+ }
+ return $protected;
+ }
+
public static function renderCustomHeaderScripts()
{
if (XAGIO_DISABLE_SCRIPTS_LOGGED_IN == TRUE) {
@@ -686,10 +741,10 @@
if ($XAGIO_SEO_SCRIPTS_ENABLE === "") {
$scripts = '';
} else {
- $scripts = get_post_meta($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_HEADER', TRUE);
+ $scripts = self::postScripts($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_HEADER');
}
} else {
- $scripts = get_post_meta($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_HEADER', TRUE);
+ $scripts = self::postScripts($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_HEADER');
}
@@ -741,10 +796,10 @@
if ($XAGIO_SEO_SCRIPTS_ENABLE === "") {
$scripts = '';
} else {
- $scripts = get_post_meta($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_FOOTER', TRUE);
+ $scripts = self::postScripts($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_FOOTER');
}
} else {
- $scripts = get_post_meta($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_FOOTER', TRUE);
+ $scripts = self::postScripts($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_FOOTER');
}
if ($disable_global != 1) {
@@ -795,10 +850,10 @@
if ($XAGIO_SEO_SCRIPTS_ENABLE === "") {
$scripts = '';
} else {
- $scripts = get_post_meta($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_BODY', TRUE);
+ $scripts = self::postScripts($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_BODY');
}
} else {
- $scripts = get_post_meta($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_BODY', TRUE);
+ $scripts = self::postScripts($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_BODY');
}
if ($disable_global != 1) {
@@ -1021,6 +1076,10 @@
$post_id = abs(intval($_POST['post_id']));
$status = abs(intval($_POST['status']));
+ if (!current_user_can('edit_post', $post_id)) {
+ wp_die('You are not allowed to edit this post.', 'Forbidden', ['response' => 403]);
+ }
+
update_post_meta($post_id, 'XAGIO_SEO_SEARCH_PREVIEW_ENABLE', $status);
}
@@ -2102,22 +2161,7 @@
}
}
- $allowed_tags = [
- 'script' => [
- 'src' => true,
- 'type' => true,
- 'async' => true,
- 'defer' => true,
- 'crossorigin' => true,
- 'integrity' => true,
- 'nomodule' => true,
- 'charset' => true,
- 'referrerpolicy' => true,
- 'id' => true,
- 'class' => true,
- 'data-*' => true
- ]
- ];
+ $allowed_tags = self::scriptAllowedTags();
// Define field configurations with their sanitization functions
$field_configs = [
--- a/xagio-seo/modules/settings/models/xagio_settings.php
+++ b/xagio-seo/modules/settings/models/xagio_settings.php
@@ -197,6 +197,26 @@
]);
}
+ // Rebuild the rewrite rules only when the category base setting or the category slugs change
+ add_action('wp_loaded', [
+ 'XAGIO_MODEL_SETTINGS',
+ 'maybeFlushRewriteRules'
+ ]);
+ }
+
+ public static function maybeFlushRewriteRules()
+ {
+ $state = 'off';
+ if (XAGIO_REMOVE_CATEGORY_BASE) {
+ $slugs = get_categories(['hide_empty' => false, 'fields' => 'id=>slug']);
+ $state = md5(wp_json_encode(is_array($slugs) ? $slugs : []));
+ }
+
+ if (get_option('XAGIO_CATEGORY_REWRITE_STATE') === $state) {
+ return;
+ }
+
+ update_option('XAGIO_CATEGORY_REWRITE_STATE', $state);
flush_rewrite_rules();
}
@@ -871,19 +891,10 @@
xagio_jsonc(XAGIO_MODEL_BACKUPS::doBackup());
}
- public static function exportOptions()
+ // Options that the settings export writes and the import accepts
+ private static function exportOptionKeys()
{
- check_ajax_referer('xagio_nonce', '_xagio_nonce');
-
- // Set headers for plain text and JSON download
- header("Content-type: text/plain");
- header('Content-Disposition: attachment; filename=Xagio_Export_Settings_' . gmdate('Y-m-d_H:i:s') . '.psexp');
- header('Content-type: application/json');
-
- global $wpdb;
-
- // List of options to export
- $all_wp_options = [
+ return [
'XAGIO_DISABLE_HTML_FOOTPRINT',
'XAGIO_DISABLE_WP_CANONICALS',
'XAGIO_FORCE_HOMEPAGE_SCHEMA',
@@ -923,18 +934,12 @@
'XAGIO_RECAPTCHA',
'ps_remove_footprint'
];
+ }
- $return = [];
- // Collect all options
- foreach ($all_wp_options as $wp_option) {
- $option_value = get_option($wp_option);
- if ($option_value !== false) {
- $return['options'][$wp_option] = $option_value;
- }
- }
-
- // List of post meta to export
- $all_post_meta = [
+ // Post meta that the settings export writes and the import accepts
+ private static function exportMetaKeys()
+ {
+ return [
'XAGIO_SEO',
'XAGIO_SEO_SEARCH_PREVIEW_ENABLE',
'XAGIO_SEO_SOCIAL_ENABLE',
@@ -958,12 +963,39 @@
'XAGIO_SEO_FACEBOOK_IMAGE',
'XAGIO_SEO_NOTES',
];
+ }
+
+ public static function exportOptions()
+ {
+ check_ajax_referer('xagio_nonce', '_xagio_nonce');
+
+ // Set headers for plain text and JSON download
+ header("Content-type: text/plain");
+ header('Content-Disposition: attachment; filename=Xagio_Export_Settings_' . gmdate('Y-m-d_H:i:s') . '.psexp');
+ header('Content-type: application/json');
+
+ global $wpdb;
+
+ // List of options to export
+ $all_wp_options = self::exportOptionKeys();
+
+ $return = [];
+ // Collect all options
+ foreach ($all_wp_options as $wp_option) {
+ $option_value = get_option($wp_option);
+ if ($option_value !== false) {
+ $return['options'][$wp_option] = $option_value;
+ }
+ }
+
+ // List of post meta to export
+ $all_post_meta = self::exportMetaKeys();
$by_id = [];
// Collect all post meta
foreach ($all_post_meta as $meta_key) {
// Securely prepare the query using wpdb::prepare
- $results = $wpdb->get_results($wpdb->prepare("SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE meta_key = %s", $meta_key), ARRAY_A);
+ $results = $wpdb->get_results($wpdb->prepare("SELECT post_id, meta_key, meta_value FROM {$wpdb->postmeta} WHERE meta_key = %s", $meta_key), ARRAY_A);
// Organize results by post ID
foreach ($results as $xagio_result) {
@@ -1014,15 +1046,29 @@
$options = $json['options'];
$postmeta = $json['postmeta'];
+ // Only the keys the export writes, so a crafted file cannot change other WordPress settings
+ $allowed_options = self::exportOptionKeys();
+ $allowed_meta = self::exportMetaKeys();
+
foreach ($options as $xagio_key => $option) {
+ if (!in_array($xagio_key, $allowed_options, TRUE)) {
+ continue;
+ }
update_option($xagio_key, $option);
}
foreach ($postmeta as $xagio_key => $metas) {
- $post_id = $xagio_key;
- if (get_post_status($post_id) != FALSE) {
+ $post_id = absint($xagio_key);
+ if ($post_id && get_post_status($post_id) != FALSE && is_array($metas)) {
foreach ($metas as $xagio_value) {
- update_post_meta($post_id, $xagio_value['meta_key'], maybe_unserialize($xagio_value['meta_value']));
+ if (!isset($xagio_value['meta_key'], $xagio_value['meta_value']) || !in_array($xagio_value['meta_key'], $allowed_meta, TRUE)) {
+ continue;
+ }
+ $meta_value = $xagio_value['meta_value'];
+ if (is_serialized($meta_value)) {
+ $meta_value = @unserialize(trim($meta_value), ['allowed_classes' => FALSE]);
+ }
+ update_post_meta($post_id, $xagio_value['meta_key'], $meta_value);
}
}
}
--- a/xagio-seo/xagio-seo.php
+++ b/xagio-seo/xagio-seo.php
@@ -3,7 +3,7 @@
* Plugin Name: Xagio SEO - AI Powered SEO
* Plugin URI: https://xagio.net/
* Description: WordPress Management & AI Search Engine Optimization combined. Do everything from a single location with one software.
- * Version: 7.1.0.54
+ * Version: 7.1.0.55
* Author: Xagio
* Author URI: https://xagio.com
* License: GPLv3 or later