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:
@@ -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 = '/';
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
|
@@ -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";
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user