Changeset 3462384
- Timestamp:
- 02/16/2026 10:25:00 AM (3 weeks ago)
- Location:
- memsource-connector/trunk
- Files:
-
- 4 edited
-
memsource.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
src/Service/CustomFields/CustomFieldsDecodeService.php (modified) (2 diffs)
-
src/Service/ExternalPlugin/ElementorPlugin.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
memsource-connector/trunk/memsource.php
r3452798 r3462384 5 5 Plugin URI: https://support.phrase.com/hc/en-us/articles/5709657294620 6 6 Description: Localize WordPress websites with the help of professional translation tools: translation memories, terminology bases and quality checkers. 7 Version: 4.7. 87 Version: 4.7.9 8 8 Text Domain: memsource 9 9 Domain Path: /locale … … 18 18 19 19 define('MEMSOURCE_PLUGIN_PATH', dirname(__FILE__)); 20 define('MEMSOURCE_PLUGIN_VERSION', '4.7. 8');20 define('MEMSOURCE_PLUGIN_VERSION', '4.7.9'); 21 21 define('MEMSOURCE_PLUGIN_DIR_URL', plugin_dir_url(__FILE__)); 22 22 define('MEMSOURCE_PLUGIN_REQUIERED_PHP_VERSION', '7.4'); -
memsource-connector/trunk/readme.txt
r3452798 r3462384 33 33 == Changelog == 34 34 35 = 4.7.9 = 36 *Release Date - 16 Feb 2026* 37 38 * Improved handling of Elementor data 39 35 40 = 4.7.8 = 36 41 *Release Date - 3 Feb 2026* -
memsource-connector/trunk/src/Service/CustomFields/CustomFieldsDecodeService.php
r3452798 r3462384 89 89 90 90 if ($this->elementorPlugin->isElementorDataField($match[2])) { 91 $value = $this->elementorPlugin->decodeElementorDataField($value); 91 $elementorValue = $match[3]; 92 if (!$this->elementorPlugin->includesElementorDataField($elementorValue)) { 93 preg_match_all($this->getElementorRegex(), $string, $eMatches, PREG_SET_ORDER); 94 $elementorValue = $eMatches[0][3]; 95 } 96 $value = $this->elementorPlugin->decodeElementorDataField($elementorValue); 92 97 } elseif ($this->acfPlugin->isAcfEncodedCustomField($value)) { 93 98 $value = $this->acfPlugin->decodeAcfCustomField($value); … … 130 135 ]; 131 136 } 137 138 /** 139 * Return a stricter regex pattern for Elementor data fields 140 * 141 * @return string 142 */ 143 private function getElementorRegex(): string 144 { 145 return '/<div data-type="custom_field_v2" data-source-id="(\d+)" data-key="(_elementor_data)"><div id="value">([\s\S]*?<!--_elementor_data_.*?-->)<\/div><\/div>/s'; 146 } 132 147 } -
memsource-connector/trunk/src/Service/ExternalPlugin/ElementorPlugin.php
r3411119 r3462384 18 18 19 19 private const ELEMENTOR_RESULT_PATTERN_ENCODE = '<!--_elementor_data_%s-->'; 20 private const ELEMENTOR_RESULT_PATTERN_DECODE = '| .+</div><!--_elementor_data_(.+)-->|sm';20 private const ELEMENTOR_RESULT_PATTERN_DECODE = '|<!--_elementor_data_(.+)-->|sm'; 21 21 22 22 private const ELEMENTOR_TRANSLATABLE_FIELDS = [ … … 385 385 } 386 386 } 387 388 public function includesElementorDataField($translations): bool 389 { 390 preg_match(self::ELEMENTOR_RESULT_PATTERN_DECODE, $translations, $json); 391 return $json[1] !== null; 392 } 387 393 }
Note: See TracChangeset
for help on using the changeset viewer.