Fix deprecated php syntax

This commit is contained in:
Dan Hensby 2020-04-01 13:32:31 +01:00
parent 3f3f6854fe
commit 6c8dc0fd99
No known key found for this signature in database
GPG Key ID: F76D6B5FE0626A99
7 changed files with 10 additions and 7 deletions

View File

@ -31,8 +31,11 @@ matrix:
- php: 7.3 - php: 7.3
env: DB=SQLITE env: DB=SQLITE
- php: 7.4snapshot - php: 7.4
env: DB=SQLITE INSTALL_PHPUNIT_FORK=1 env: DB=SQLITE INSTALL_PHPUNIT_FORK=1
dist: xenial
services:
- mysql
# CMS test # CMS test
- php: 5.5 - php: 5.5

View File

@ -1993,7 +1993,7 @@ class LeftAndMain_TreeNode extends ViewableData {
// Get additional filter classes // Get additional filter classes
if($this->filter && ($filterClasses = $this->filter->getPageClasses($this->obj))) { if($this->filter && ($filterClasses = $this->filter->getPageClasses($this->obj))) {
if(is_array($filterClasses)) { if(is_array($filterClasses)) {
$filterClasses = implode(' ' . $filterClasses); $filterClasses = implode(' ', $filterClasses);
} }
$classes .= ' ' . $filterClasses; $classes .= ' ' . $filterClasses;
} }

View File

@ -768,7 +768,7 @@ class Email extends ViewableData {
return strtr($email, $obfuscated); return strtr($email, $obfuscated);
case 'hex' : case 'hex' :
$encoded = ''; $encoded = '';
for ($x=0; $x < strlen($email); $x++) $encoded .= '&#x' . bin2hex($email{$x}).';'; for ($x=0; $x < strlen($email); $x++) $encoded .= '&#x' . bin2hex($email[$x]).';';
return $encoded; return $encoded;
default: default:
user_error('Email::obfuscate(): Unknown obfuscation method', E_USER_NOTICE); user_error('Email::obfuscate(): Unknown obfuscation method', E_USER_NOTICE);

View File

@ -1810,7 +1810,7 @@ class Form extends RequestHandler {
* @return string * @return string
*/ */
public function extraClass() { public function extraClass() {
return implode(array_unique($this->extraClasses), ' '); return implode(' ', array_unique($this->extraClasses));
} }
/** /**

View File

@ -2615,7 +2615,7 @@ class i18n extends SS_Object implements TemplateGlobalProvider, Flushable {
if(is_dir($themesBase)) { if(is_dir($themesBase)) {
foreach(scandir($themesBase) as $theme) { foreach(scandir($themesBase) as $theme) {
if( if(
strpos($theme, Config::inst()->get('SSViewer', 'theme')) === 0 strpos($theme, (string)Config::inst()->get('SSViewer', 'theme')) === 0
&& file_exists("{$themesBase}/{$theme}/lang/") && file_exists("{$themesBase}/{$theme}/lang/")
) { ) {
$filename = $adapter->getFilenameForLocale($locale); $filename = $adapter->getFilenameForLocale($locale);

View File

@ -767,7 +767,7 @@ class Image extends File implements Flushable {
foreach($matches as $formatdir) { foreach($matches as $formatdir) {
$prepend[] = $formatdir[0]; $prepend[] = $formatdir[0];
} }
$filename = implode($prepend) . $filename; $filename = implode('', $prepend) . $filename;
if (!preg_match($pattern['FullPattern'], $filename)) { if (!preg_match($pattern['FullPattern'], $filename)) {
throw new InvalidArgumentException('Filename ' . $filename throw new InvalidArgumentException('Filename ' . $filename

View File

@ -88,7 +88,7 @@ class Text extends StringField {
} }
} }
return count($output)==0 ? '' : implode($output, '. ') . '.'; return count($output)==0 ? '' : implode('. ', $output) . '.';
} }