Skip to content

Commit ab31f2c

Browse files
Aleksander KokoAleksander Koko
authored andcommitted
fixed String problem on PHP7
1 parent 988f63a commit ab31f2c

File tree

10 files changed

+22
-22
lines changed

10 files changed

+22
-22
lines changed

core/Admin.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace phpList;
33

4-
use phpList\helper\String;
4+
use phpList\helper\StringClass;
55
use phpList\helper\Util;
66
use phpList\Entity\AdminEntity;
77

@@ -23,7 +23,7 @@ public function __construct( $adminModel, $pass )
2323
*/
2424
public function setLoginname($loginname)
2525
{
26-
$this->loginname = strtolower(String::normalize($loginname));
26+
$this->loginname = strtolower(StringClass::normalize($loginname));
2727
return $this->isLoginUnique();
2828
}
2929

@@ -34,7 +34,7 @@ public function setLoginname($loginname)
3434
*/
3535
public function setNamelc($namelc)
3636
{
37-
$this->namelc = strtolower(String::normalize($namelc));
37+
$this->namelc = strtolower(StringClass::normalize($namelc));
3838
}
3939

4040
public $email;
@@ -105,7 +105,7 @@ public static function getAdmins($search = '')
105105
$admins = array();
106106
$condition = '';
107107
if ($search != '') {
108-
$search = String::sqlEscape($search);
108+
$search = StringClass::sqlEscape($search);
109109
$condition = sprintf(' WHERE loginname LIKE "%%%s%%" OR email LIKE "%%%s%%"', $search, $search);
110110
}
111111

@@ -159,7 +159,7 @@ public function save()
159159
*/
160160
public function update($modifiedby)
161161
{
162-
$privileges = String::sqlEscape(serialize($this->privileges));
162+
$privileges = StringClass::sqlEscape(serialize($this->privileges));
163163
phpList::DB()->query(
164164
sprintf(
165165
'UPDATE %s SET

core/Campaign.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use Exception;
55
use phpList\Entity\CampaignEntity;
66
use phpList\Entity\MailingListEntity;
7-
use phpList\helper\String;
7+
use phpList\helper\StringClass;
88
use phpList\helper\Util;
99

1010
class Campaign
@@ -123,7 +123,7 @@ public function getCampaignsBy($status, $subject = '', $owner = 0, $order = '',
123123
$condition .= ') ';
124124

125125
if ($subject != '') {
126-
$condition .= ' AND subject LIKE "%' . String::sqlEscape($subject) . '%" ';
126+
$condition .= ' AND subject LIKE "%' . StringClass::sqlEscape($subject) . '%" ';
127127
}
128128
if ($owner != 0) {
129129
$condition .= sprintf(' AND owner = %d', $owner);

core/Model/AdminModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
namespace phpList\Model;
33

44
use phpList\Entity\SubscriberEntity;
5-
use phpList\helper\String;
5+
use phpList\helper\StringClass;
66

77
class AdminModel {
88

core/Model/ListModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
namespace phpList\Model;
33

44
use phpList\Entity\SubscriberEntity;
5-
use phpList\helper\String;
5+
use phpList\helper\StringClass;
66

77
class ListModel {
88

core/Model/SubscriberModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
namespace phpList\Model;
33

44
use phpList\Entity\SubscriberEntity;
5-
use phpList\helper\String;
5+
use phpList\helper\StringClass;
66

77
class SubscriberModel {
88

core/SubscriberManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use phpList\Subscriber;
55
use phpList\Entity\SubscriberEntity;
6-
use phpList\helper\String;
6+
use phpList\helper\StringClass;
77

88
class SubscriberManager
99
{
@@ -290,7 +290,7 @@ public function getCleanAttributes(SubscriberEntity $scrEntity)
290290
foreach ($scrEntity->getAttributes() as $key => $val) {
291291
## in the help, we only list attributes with "strlen < 20"
292292
if (strlen($key) < 20) {
293-
$clean_attributes[String::cleanAttributeName($key)] = $val;
293+
$clean_attributes[StringClass::cleanAttributeName($key)] = $val;
294294
}
295295
}
296296
return $clean_attributes;

core/helper/PrepareCampaign.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ public static function sendEmail(
276276

277277
if ($cached_campaign->htmlformatted) {
278278
if (empty($cached_campaign->textcontent)) {
279-
$textcontent = String::HTML2Text($content);
279+
$textcontent = StringClass::HTML2Text($content);
280280
} else {
281281
$textcontent = $cached_campaign->textcontent;
282282
}
@@ -1584,7 +1584,7 @@ public static function precacheCampaign($campaign, $forwardContent = false)
15841584
$cached_campaign->footer = $forwardContent ? stripslashes($campaign->forwardfooter) : $campaign->footer;
15851585

15861586
if (strip_tags($cached_campaign->footer) != $cached_campaign->footer) {
1587-
$cached_campaign->textfooter = String::HTML2Text($cached_campaign->footer);
1587+
$cached_campaign->textfooter = StringClass::HTML2Text($cached_campaign->footer);
15881588
$cached_campaign->htmlfooter = $cached_campaign->footer;
15891589
} else {
15901590
$cached_campaign->textfooter = $cached_campaign->footer;
@@ -1644,7 +1644,7 @@ public static function precacheCampaign($campaign, $forwardContent = false)
16441644

16451645

16461646
/*if ($cached_campaign->htmlformatted) {
1647-
# $cached->content = String::compressContent($cached->content);
1647+
# $cached->content = StringClass::compressContent($cached->content);
16481648
}*/
16491649

16501650
//$cached_campaign->google_track = $campaign->google_track;

core/helper/String.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Class containing string helper functions
99
* @package phpList
1010
*/
11-
class String
11+
class StringClass
1212
{
1313
/**
1414
* Normalize text
@@ -121,7 +121,7 @@ public static function HTML2Text($text)
121121
500
122122
);
123123

124-
$text = String::replaceChars($text);
124+
$text = StringClass::replaceChars($text);
125125

126126
$text = preg_replace("/###NL###/", "\n", $text);
127127
$text = preg_replace("/\n /", "\n", $text);

core/helper/Util.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -610,15 +610,15 @@ public function blacklistEmail($email_address, $reason = '', $date = '')
610610
} else {
611611
$sqldate = '"' . $date . '"';
612612
}
613-
$email_address = String::sqlEscape($email_address);
613+
$email_address = StringClass::sqlEscape($email_address);
614614

615615
#0012262: blacklist only email when email bounces. (not subscribers): Function split so email can be blacklisted without blacklisting subscriber
616616
$this->db->query(
617617
sprintf(
618618
'INSERT IGNORE INTO %s (email,added)
619619
VALUES("%s",%s)',
620620
$this->config->getTableName('user_blacklist'),
621-
String::sqlEscape($email_address),
621+
StringClass::sqlEscape($email_address),
622622
$sqldate
623623
)
624624
);
@@ -726,7 +726,7 @@ public function parseEmailAndName($string, $default_address)
726726

727727
return [
728728
'email' => $email_address,
729-
'name' => String::removeDoubleSpaces(trim($name))
729+
'name' => StringClass::removeDoubleSpaces(trim($name))
730730
];
731731
}
732732

core/phpListMailer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace phpList;
33

4-
use phpList\helper\String;
4+
use phpList\helper\StringClass;
55
use phpList\helper\Util;
66
use PHPMailer;
77

@@ -685,7 +685,7 @@ public static function constructSystemMail($message, $subject = '')
685685

686686
if ($hasHTML) {
687687
$message = stripslashes($message);
688-
$textmessage = String::HTML2Text($message);
688+
$textmessage = StringClass::HTML2Text($message);
689689
$htmlmessage = $message;
690690
} else {
691691
$textmessage = $message;

0 commit comments

Comments
 (0)