Changeset 2504597
- Timestamp:
- 03/27/2021 10:16:52 PM (5 years ago)
- Location:
- snazzy-maps/trunk
- Files:
-
- 3 edited
-
additional_php/SnazzyMaps_Services_JSON.php (modified) (18 diffs)
-
readme.txt (modified) (2 diffs)
-
snazzymaps.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
snazzy-maps/trunk/additional_php/SnazzyMaps_Services_JSON.php
r1918571 r2504597 154 154 } 155 155 156 $bytes = (ord($utf16 {0}) << 8) | ord($utf16{1});156 $bytes = (ord($utf16[0]) << 8) | ord($utf16[1]); 157 157 158 158 switch(true) { … … 207 207 // return a UTF-16 character from a 2-byte UTF-8 char 208 208 // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 209 return chr(0x07 & (ord($utf8 {0}) >> 2))210 . chr((0xC0 & (ord($utf8 {0}) << 6))211 | (0x3F & ord($utf8 {1})));209 return chr(0x07 & (ord($utf8[0]) >> 2)) 210 . chr((0xC0 & (ord($utf8[0]) << 6)) 211 | (0x3F & ord($utf8[1]))); 212 212 213 213 case 3: 214 214 // return a UTF-16 character from a 3-byte UTF-8 char 215 215 // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 216 return chr((0xF0 & (ord($utf8 {0}) << 4))217 | (0x0F & (ord($utf8 {1}) >> 2)))218 . chr((0xC0 & (ord($utf8 {1}) << 6))219 | (0x7F & ord($utf8 {2})));216 return chr((0xF0 & (ord($utf8[0]) << 4)) 217 | (0x0F & (ord($utf8[1]) >> 2))) 218 . chr((0xC0 & (ord($utf8[1]) << 6)) 219 | (0x7F & ord($utf8[2]))); 220 220 } 221 221 … … 262 262 for ($c = 0; $c < $strlen_var; ++$c) { 263 263 264 $ord_var_c = ord($var {$c});264 $ord_var_c = ord($var[$c]); 265 265 266 266 switch (true) { … … 285 285 case $ord_var_c == 0x5C: 286 286 // double quote, slash, slosh 287 $ascii .= '\\'.$var {$c};287 $ascii .= '\\'.$var[$c]; 288 288 break; 289 289 290 290 case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)): 291 291 // characters U-00000000 - U-0000007F (same as ASCII) 292 $ascii .= $var {$c};292 $ascii .= $var[$c]; 293 293 break; 294 294 … … 296 296 // characters U-00000080 - U-000007FF, mask 110XXXXX 297 297 // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 298 $char = pack('C*', $ord_var_c, ord($var {$c + 1}));298 $char = pack('C*', $ord_var_c, ord($var[$c + 1])); 299 299 $c += 1; 300 300 $utf16 = $this->utf82utf16($char); … … 306 306 // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 307 307 $char = pack('C*', $ord_var_c, 308 ord($var {$c + 1}),309 ord($var {$c + 2}));308 ord($var[$c + 1]), 309 ord($var[$c + 2])); 310 310 $c += 2; 311 311 $utf16 = $this->utf82utf16($char); … … 317 317 // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 318 318 $char = pack('C*', $ord_var_c, 319 ord($var {$c + 1}),320 ord($var {$c + 2}),321 ord($var {$c + 3}));319 ord($var[$c + 1]), 320 ord($var[$c + 2]), 321 ord($var[$c + 3])); 322 322 $c += 3; 323 323 $utf16 = $this->utf82utf16($char); … … 329 329 // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 330 330 $char = pack('C*', $ord_var_c, 331 ord($var {$c + 1}),332 ord($var {$c + 2}),333 ord($var {$c + 3}),334 ord($var {$c + 4}));331 ord($var[$c + 1]), 332 ord($var[$c + 2]), 333 ord($var[$c + 3]), 334 ord($var[$c + 4])); 335 335 $c += 4; 336 336 $utf16 = $this->utf82utf16($char); … … 342 342 // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 343 343 $char = pack('C*', $ord_var_c, 344 ord($var {$c + 1}),345 ord($var {$c + 2}),346 ord($var {$c + 3}),347 ord($var {$c + 4}),348 ord($var {$c + 5}));344 ord($var[$c + 1]), 345 ord($var[$c + 2]), 346 ord($var[$c + 3]), 347 ord($var[$c + 4]), 348 ord($var[$c + 5])); 349 349 $c += 5; 350 350 $utf16 = $this->utf82utf16($char); … … 521 521 522 522 $substr_chrs_c_2 = substr($chrs, $c, 2); 523 $ord_chrs_c = ord($chrs {$c});523 $ord_chrs_c = ord($chrs[$c]); 524 524 525 525 switch (true) { … … 551 551 if (($delim == '"' && $substr_chrs_c_2 != '\\\'') || 552 552 ($delim == "'" && $substr_chrs_c_2 != '\\"')) { 553 $utf8 .= $chrs {++$c};553 $utf8 .= $chrs[++$c]; 554 554 } 555 555 break; … … 564 564 565 565 case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F): 566 $utf8 .= $chrs {$c};566 $utf8 .= $chrs[$c]; 567 567 break; 568 568 … … 611 611 // array, or object notation 612 612 613 if ($str {0}== '[') {613 if ($str[0] == '[') { 614 614 $stk = array(SnazzyMaps_Services_JSON_IN_ARR); 615 615 $arr = array(); … … 650 650 $substr_chrs_c_2 = substr($chrs, $c, 2); 651 651 652 if (($c == $strlen_chrs) || (($chrs {$c}== ',') && ($top['what'] == SnazzyMaps_Services_JSON_SLICE))) {652 if (($c == $strlen_chrs) || (($chrs[$c] == ',') && ($top['what'] == SnazzyMaps_Services_JSON_SLICE))) { 653 653 // found a comma that is not inside a string, array, etc., 654 654 // OR we've reached the end of the character list … … 692 692 } 693 693 694 } elseif ((($chrs {$c} == '"') || ($chrs{$c}== "'")) && ($top['what'] != SnazzyMaps_Services_JSON_IN_STR)) {694 } elseif ((($chrs[$c] == '"') || ($chrs[$c] == "'")) && ($top['what'] != SnazzyMaps_Services_JSON_IN_STR)) { 695 695 // found a quote, and we are not inside a string 696 array_push($stk, array('what' => SnazzyMaps_Services_JSON_IN_STR, 'where' => $c, 'delim' => $chrs {$c}));696 array_push($stk, array('what' => SnazzyMaps_Services_JSON_IN_STR, 'where' => $c, 'delim' => $chrs[$c])); 697 697 //print("Found start of string at {$c}\n"); 698 698 699 } elseif (($chrs {$c}== $top['delim']) &&699 } elseif (($chrs[$c] == $top['delim']) && 700 700 ($top['what'] == SnazzyMaps_Services_JSON_IN_STR) && 701 701 ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) { … … 706 706 //print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n"); 707 707 708 } elseif (($chrs {$c}== '[') &&708 } elseif (($chrs[$c] == '[') && 709 709 in_array($top['what'], array(SnazzyMaps_Services_JSON_SLICE, SnazzyMaps_Services_JSON_IN_ARR, SnazzyMaps_Services_JSON_IN_OBJ))) { 710 710 // found a left-bracket, and we are in an array, object, or slice … … 712 712 //print("Found start of array at {$c}\n"); 713 713 714 } elseif (($chrs {$c}== ']') && ($top['what'] == SnazzyMaps_Services_JSON_IN_ARR)) {714 } elseif (($chrs[$c] == ']') && ($top['what'] == SnazzyMaps_Services_JSON_IN_ARR)) { 715 715 // found a right-bracket, and we're in an array 716 716 array_pop($stk); 717 717 //print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); 718 718 719 } elseif (($chrs {$c}== '{') &&719 } elseif (($chrs[$c] == '{') && 720 720 in_array($top['what'], array(SnazzyMaps_Services_JSON_SLICE, SnazzyMaps_Services_JSON_IN_ARR, SnazzyMaps_Services_JSON_IN_OBJ))) { 721 721 // found a left-brace, and we are in an array, object, or slice … … 723 723 //print("Found start of object at {$c}\n"); 724 724 725 } elseif (($chrs {$c}== '}') && ($top['what'] == SnazzyMaps_Services_JSON_IN_OBJ)) {725 } elseif (($chrs[$c] == '}') && ($top['what'] == SnazzyMaps_Services_JSON_IN_OBJ)) { 726 726 // found a right-brace, and we're in an object 727 727 array_pop($stk); -
snazzy-maps/trunk/readme.txt
r2393288 r2504597 4 4 Tags: google,maps,google maps,styled maps,styles,color,schemes,themes 5 5 Requires at least: 3.0 6 Tested up to: 5. 5.17 Stable tag: 1. 3.06 Tested up to: 5.7 7 Stable tag: 1.4.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 99 99 == Changelog == 100 100 101 = 1.4.0 = 102 Release Date: March 27th, 2021 103 104 * Update: Minor changes to support PHP 8. 105 * Update: Verified that the plugin works with newer versions of WordPress up to 5.7. 106 101 107 = 1.3.0 = 102 108 Release Date: October 4th, 2020 -
snazzy-maps/trunk/snazzymaps.php
r2393288 r2504597 4 4 * Plugin URI: https://snazzymaps.com/plugins 5 5 * Description: Apply styles to your Google Maps with the official Snazzy Maps WordPress plugin. 6 * Version: 1. 3.06 * Version: 1.4.0 7 7 * Author: Snazzy Maps 8 8 * Author URI: https://snazzymaps.com … … 31 31 define('SNAZZY_MAPS_API_BASE', 'https://snazzymaps.com/'); 32 32 define('SNAZZY_MAPS_API_KEY', 'ecaccc3c-44fa-486c-9503-5d473587a493'); 33 define('SNAZZY_MAPS_VERSION_NUMBER', '1. 3.0');33 define('SNAZZY_MAPS_VERSION_NUMBER', '1.4.0'); 34 34 35 35 if(!defined('_DS')) {
Note: See TracChangeset
for help on using the changeset viewer.