1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-08 07:47:00 +02:00

Fix issue processwire/processwire-issues#1531 PHP-8 deprecation warnings

This commit is contained in:
Ryan Cramer
2022-02-25 12:02:51 -05:00
parent 7796807d19
commit 3c139fec06
4 changed files with 4 additions and 4 deletions

View File

@@ -1925,7 +1925,7 @@ class PagesPathFinder extends Wire {
$segments = $this->languageSegments();
$segments[] = Pages::defaultRootName;
foreach($segments as $segment) {
if(!strlen($segment)) continue;
if($segment === null || !strlen($segment)) continue;
if($path !== "/$segment" && strpos($path, "/$segment/") !== 0) continue;
list(,$path) = explode("/$segment", $path, 2);
if($path === '') $path = '/';

View File

@@ -75,7 +75,7 @@ class FieldtypeRepeater extends Fieldtype implements ConfigurableModule {
* @var bool
*
*/
static protected $isReady = false;
static protected $isReady = array();
/**
* When non-zero, a deletePageField function call occurred and we shouldn't re-create any repeater parents

View File

@@ -90,7 +90,7 @@ class InputfieldMarkup extends InputfieldWrapper {
if($markupFunction !== null & is_callable($markupFunction)) {
$out .= "\n" . call_user_func($markupFunction, $this);
}
if(strlen($markupText)) {
if(is_string($markupText) && strlen($markupText)) {
$out .= "\n" . $markupText;
}
$out = trim($out);

View File

@@ -512,7 +512,7 @@ class LanguageSupportPageNames extends WireData implements Module, ConfigurableM
// special case: homepage
$name = $isDefault ? '' : $page->get("name$language");
if($isDefault && $this->useHomeSegment) $name = $page->name;
if($name == Pages::defaultRootName || !strlen($name)) return '/';
if($name == Pages::defaultRootName || $name === null || !strlen($name)) return '/';
return $template->slashUrls ? "/$name/" : "/$name";
}