Plugin Directory

Changeset 2504597


Ignore:
Timestamp:
03/27/2021 10:16:52 PM (5 years ago)
Author:
atmistinc
Message:
  • Update: Minor changes to support PHP 8.
Location:
snazzy-maps/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • snazzy-maps/trunk/additional_php/SnazzyMaps_Services_JSON.php

    r1918571 r2504597  
    154154        }
    155155
    156         $bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
     156        $bytes = (ord($utf16[0]) << 8) | ord($utf16[1]);
    157157
    158158        switch(true) {
     
    207207                // return a UTF-16 character from a 2-byte UTF-8 char
    208208                // 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])));
    212212
    213213            case 3:
    214214                // return a UTF-16 character from a 3-byte UTF-8 char
    215215                // 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])));
    220220        }
    221221
     
    262262                for ($c = 0; $c < $strlen_var; ++$c) {
    263263
    264                     $ord_var_c = ord($var{$c});
     264                    $ord_var_c = ord($var[$c]);
    265265
    266266                    switch (true) {
     
    285285                        case $ord_var_c == 0x5C:
    286286                            // double quote, slash, slosh
    287                             $ascii .= '\\'.$var{$c};
     287                            $ascii .= '\\'.$var[$c];
    288288                            break;
    289289
    290290                        case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
    291291                            // characters U-00000000 - U-0000007F (same as ASCII)
    292                             $ascii .= $var{$c};
     292                            $ascii .= $var[$c];
    293293                            break;
    294294
     
    296296                            // characters U-00000080 - U-000007FF, mask 110XXXXX
    297297                            // 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]));
    299299                            $c += 1;
    300300                            $utf16 = $this->utf82utf16($char);
     
    306306                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
    307307                            $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]));
    310310                            $c += 2;
    311311                            $utf16 = $this->utf82utf16($char);
     
    317317                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
    318318                            $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]));
    322322                            $c += 3;
    323323                            $utf16 = $this->utf82utf16($char);
     
    329329                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
    330330                            $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]));
    335335                            $c += 4;
    336336                            $utf16 = $this->utf82utf16($char);
     
    342342                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
    343343                            $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]));
    349349                            $c += 5;
    350350                            $utf16 = $this->utf82utf16($char);
     
    521521
    522522                        $substr_chrs_c_2 = substr($chrs, $c, 2);
    523                         $ord_chrs_c = ord($chrs{$c});
     523                        $ord_chrs_c = ord($chrs[$c]);
    524524
    525525                        switch (true) {
     
    551551                                if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
    552552                                   ($delim == "'" && $substr_chrs_c_2 != '\\"')) {
    553                                     $utf8 .= $chrs{++$c};
     553                                    $utf8 .= $chrs[++$c];
    554554                                }
    555555                                break;
     
    564564
    565565                            case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
    566                                 $utf8 .= $chrs{$c};
     566                                $utf8 .= $chrs[$c];
    567567                                break;
    568568
     
    611611                    // array, or object notation
    612612
    613                     if ($str{0} == '[') {
     613                    if ($str[0] == '[') {
    614614                        $stk = array(SnazzyMaps_Services_JSON_IN_ARR);
    615615                        $arr = array();
     
    650650                        $substr_chrs_c_2 = substr($chrs, $c, 2);
    651651
    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))) {
    653653                            // found a comma that is not inside a string, array, etc.,
    654654                            // OR we've reached the end of the character list
     
    692692                            }
    693693
    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)) {
    695695                            // 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]));
    697697                            //print("Found start of string at {$c}\n");
    698698
    699                         } elseif (($chrs{$c} == $top['delim']) &&
     699                        } elseif (($chrs[$c] == $top['delim']) &&
    700700                                 ($top['what'] == SnazzyMaps_Services_JSON_IN_STR) &&
    701701                                 ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
     
    706706                            //print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
    707707
    708                         } elseif (($chrs{$c} == '[') &&
     708                        } elseif (($chrs[$c] == '[') &&
    709709                                 in_array($top['what'], array(SnazzyMaps_Services_JSON_SLICE, SnazzyMaps_Services_JSON_IN_ARR, SnazzyMaps_Services_JSON_IN_OBJ))) {
    710710                            // found a left-bracket, and we are in an array, object, or slice
     
    712712                            //print("Found start of array at {$c}\n");
    713713
    714                         } elseif (($chrs{$c} == ']') && ($top['what'] == SnazzyMaps_Services_JSON_IN_ARR)) {
     714                        } elseif (($chrs[$c] == ']') && ($top['what'] == SnazzyMaps_Services_JSON_IN_ARR)) {
    715715                            // found a right-bracket, and we're in an array
    716716                            array_pop($stk);
    717717                            //print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
    718718
    719                         } elseif (($chrs{$c} == '{') &&
     719                        } elseif (($chrs[$c] == '{') &&
    720720                                 in_array($top['what'], array(SnazzyMaps_Services_JSON_SLICE, SnazzyMaps_Services_JSON_IN_ARR, SnazzyMaps_Services_JSON_IN_OBJ))) {
    721721                            // found a left-brace, and we are in an array, object, or slice
     
    723723                            //print("Found start of object at {$c}\n");
    724724
    725                         } elseif (($chrs{$c} == '}') && ($top['what'] == SnazzyMaps_Services_JSON_IN_OBJ)) {
     725                        } elseif (($chrs[$c] == '}') && ($top['what'] == SnazzyMaps_Services_JSON_IN_OBJ)) {
    726726                            // found a right-brace, and we're in an object
    727727                            array_pop($stk);
  • snazzy-maps/trunk/readme.txt

    r2393288 r2504597  
    44Tags: google,maps,google maps,styled maps,styles,color,schemes,themes
    55Requires at least: 3.0
    6 Tested up to: 5.5.1
    7 Stable tag: 1.3.0
     6Tested up to: 5.7
     7Stable tag: 1.4.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9999== Changelog ==
    100100
     101= 1.4.0 =
     102Release 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
    101107= 1.3.0 =
    102108Release Date: October 4th, 2020
  • snazzy-maps/trunk/snazzymaps.php

    r2393288 r2504597  
    44 * Plugin URI: https://snazzymaps.com/plugins
    55 * Description: Apply styles to your Google Maps with the official Snazzy Maps WordPress plugin.
    6  * Version: 1.3.0
     6 * Version: 1.4.0
    77 * Author: Snazzy Maps
    88 * Author URI: https://snazzymaps.com
     
    3131define('SNAZZY_MAPS_API_BASE', 'https://snazzymaps.com/');
    3232define('SNAZZY_MAPS_API_KEY', 'ecaccc3c-44fa-486c-9503-5d473587a493');
    33 define('SNAZZY_MAPS_VERSION_NUMBER', '1.3.0');
     33define('SNAZZY_MAPS_VERSION_NUMBER', '1.4.0');
    3434
    3535if(!defined('_DS')) {
Note: See TracChangeset for help on using the changeset viewer.