Changeset 3470986
- Timestamp:
- 02/27/2026 10:53:00 AM (5 weeks ago)
- Location:
- instarank/trunk
- Files:
-
- 3 edited
-
api/endpoints.php (modified) (2 diffs)
-
instarank.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
instarank/trunk/api/endpoints.php
r3470975 r3470986 5132 5132 $index = 0; 5133 5133 5134 // Protect JSON inside block comments by replacing with placeholders 5135 // Matches JSON objects between block comment opening and closing delimiters 5134 // Protect JSON inside block comments by replacing with placeholders. 5135 // Uses a non-backtracking approach: match the block comment start, 5136 // then capture everything up to the closing --> delimiter. 5136 5137 $protected = preg_replace_callback( 5137 '/( ?<=<!-- wp:[a-z0-9\/-]+ )(\{[\s\S]*?\})(?=\s*\/-->|\s*-->)/i',5138 '/(<!-- wp:[a-z0-9\/-]+ )(\{[^}]*(?:\}(?!\s*(?:\/-->|-->))[^}]*)*\})(\s*\/-->|\s*-->)/i', 5138 5139 function($matches) use (&$placeholders, &$index) { 5139 5140 $placeholder = "___BLOCK_JSON_{$index}___"; 5140 $placeholders[$placeholder] = $matches[ 0];5141 $placeholders[$placeholder] = $matches[2]; 5141 5142 $index++; 5142 return $ placeholder;5143 return $matches[1] . $placeholder . $matches[3]; 5143 5144 }, 5144 5145 $content 5145 5146 ); 5147 5148 // If preg_replace_callback failed (PCRE backtracking limit), return original 5149 if ($protected === null) { 5150 error_log('[InstaRank] decode_entities_outside_block_json: preg_replace_callback failed (PCRE limit), returning original content'); 5151 return $content; 5152 } 5146 5153 5147 5154 // Safely decode entities on everything (JSON is protected by placeholders) … … 5167 5174 $index = 0; 5168 5175 5169 // Protect JSON inside block comments 5176 // Protect JSON inside block comments using non-backtracking pattern 5170 5177 $protected = preg_replace_callback( 5171 '/( ?<=<!-- wp:[a-z0-9\/-]+ )(\{[\s\S]*?\})(?=\s*\/-->|\s*-->)/i',5178 '/(<!-- wp:[a-z0-9\/-]+ )(\{[^}]*(?:\}(?!\s*(?:\/-->|-->))[^}]*)*\})(\s*\/-->|\s*-->)/i', 5172 5179 function($matches) use (&$placeholders, &$index) { 5173 5180 $placeholder = "___BLOCK_JSON_ESC_{$index}___"; 5174 $placeholders[$placeholder] = $matches[ 0];5181 $placeholders[$placeholder] = $matches[2]; 5175 5182 $index++; 5176 return $ placeholder;5183 return $matches[1] . $placeholder . $matches[3]; 5177 5184 }, 5178 5185 $content 5179 5186 ); 5187 5188 // If preg_replace_callback failed (PCRE backtracking limit), return original 5189 if ($protected === null) { 5190 error_log('[InstaRank] replace_escapes_outside_block_json: preg_replace_callback failed (PCRE limit), returning original content'); 5191 return $content; 5192 } 5180 5193 5181 5194 // Safely replace escape sequences in non-JSON content -
instarank/trunk/instarank.php
r3470975 r3470986 4 4 * Plugin URI: https://instarank.com/wordpress-plugin 5 5 * Description: Connect your WordPress site to InstaRank for AI-powered SEO optimization, schema markup generation, and programmatic SEO. Create and sync custom post types, automatically apply SEO improvements, and generate structured data with InstaRank's AI engine. 6 * Version: 2.0. 66 * Version: 2.0.7 7 7 * Author: InstaRank 8 8 * Author URI: https://instarank.com … … 18 18 19 19 // Define plugin constants 20 define('INSTARANK_VERSION', '2.0. 6');20 define('INSTARANK_VERSION', '2.0.7'); 21 21 define('INSTARANK_PLUGIN_DIR', plugin_dir_path(__FILE__)); 22 22 define('INSTARANK_PLUGIN_URL', plugin_dir_url(__FILE__)); -
instarank/trunk/readme.txt
r3470975 r3470986 4 4 Requires at least: 5.6 5 5 Tested up to: 6.9 6 Stable tag: 2.0. 66 Stable tag: 2.0.7 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 169 169 170 170 == Changelog == 171 172 = 2.0.7 = 173 * Fix: Blank page content caused by PCRE backtracking limit failure on large Kadence blocks 174 * Fix: Replaced catastrophic-backtracking regex with efficient non-backtracking pattern 175 * Fix: Added null-check fallback for preg_replace_callback failure 171 176 172 177 = 2.0.6 =
Note: See TracChangeset
for help on using the changeset viewer.