Skip to content

Commit b951451

Browse files
author
davydovct
authored
Merge pull request #23 from jimwins/master
Fix very deprecated {} string references
2 parents a14d7d1 + c828512 commit b951451

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

lib/cleantalk-php-patch.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,23 @@ function utf8_decode($string){
4949
$offset = 0;
5050
$stringlength = strlen($string);
5151
while ($offset < $stringlength) {
52-
if ((ord($string{$offset}) | 0x07) == 0xF7) {
53-
$charval = ((ord($string{($offset + 0)}) & 0x07) << 18) &
54-
((ord($string{($offset + 1)}) & 0x3F) << 12) &
55-
((ord($string{($offset + 2)}) & 0x3F) << 6) &
56-
(ord($string{($offset + 3)}) & 0x3F);
52+
if ((ord($string[$offset]) | 0x07) == 0xF7) {
53+
$charval = ((ord($string[($offset + 0)]) & 0x07) << 18) &
54+
((ord($string[($offset + 1)]) & 0x3F) << 12) &
55+
((ord($string[($offset + 2)]) & 0x3F) << 6) &
56+
(ord($string[($offset + 3)]) & 0x3F);
5757
$offset += 4;
58-
} elseif ((ord($string{$offset}) | 0x0F) == 0xEF) {
59-
$charval = ((ord($string{($offset + 0)}) & 0x0F) << 12) &
60-
((ord($string{($offset + 1)}) & 0x3F) << 6) &
61-
(ord($string{($offset + 2)}) & 0x3F);
58+
} elseif ((ord($string[$offset]) | 0x0F) == 0xEF) {
59+
$charval = ((ord($string[($offset + 0)]) & 0x0F) << 12) &
60+
((ord($string[($offset + 1)]) & 0x3F) << 6) &
61+
(ord($string[($offset + 2)]) & 0x3F);
6262
$offset += 3;
63-
} elseif ((ord($string{$offset}) | 0x1F) == 0xDF) {
64-
$charval = ((ord($string{($offset + 0)}) & 0x1F) << 6) &
65-
(ord($string{($offset + 1)}) & 0x3F);
63+
} elseif ((ord($string[$offset]) | 0x1F) == 0xDF) {
64+
$charval = ((ord($string[($offset + 0)]) & 0x1F) << 6) &
65+
(ord($string[($offset + 1)]) & 0x3F);
6666
$offset += 2;
67-
} elseif ((ord($string{$offset}) | 0x7F) == 0x7F) {
68-
$charval = ord($string{$offset});
67+
} elseif ((ord($string[$offset]) | 0x7F) == 0x7F) {
68+
$charval = ord($string[$offset]);
6969
$offset += 1;
7070
} else {
7171
$charval = false;
@@ -77,4 +77,4 @@ function utf8_decode($string){
7777
}
7878
return $newcharstring;
7979
}
80-
}
80+
}

0 commit comments

Comments
 (0)