Skip to content

Commit

Permalink
use isset() instead of is_null()
Browse files Browse the repository at this point in the history
  • Loading branch information
ssahara committed Aug 28, 2023
1 parent 9655031 commit 9df29ad
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions helper.php
Expand Up @@ -30,7 +30,7 @@ public function html_youarehere($start_depth = 0, $id = null)
{
global $conf, $ID;

if (is_null($id)) $id = $ID;
if (!isset($id)) $id = $ID;

// prepend virtual root namespace to id that is not start page
// tiers[0] becomes array(0 => '') for virtual root
Expand Down Expand Up @@ -88,15 +88,15 @@ private function html_pagelink($id = null, $name = null, $exists = null)
{
global $conf, $ID;

if (is_null($id)) $id = $ID;
if (!isset($id)) $id = $ID;

$title = p_get_metadata($id, 'title');
if (empty($title)) $title = $id;

if (is_null($exists)) {
$class = (page_exists($id)) ? 'wikilink1' : 'wikilink2';
} else {
if (isset($exists)) {
$class = ($exists) ? 'wikilink1' : 'wikilink2';
} else {
$class = (page_exists($id)) ? 'wikilink1' : 'wikilink2';
}

$short_title = $name;
Expand Down Expand Up @@ -164,10 +164,10 @@ private function pagetitle($id = null)
{
global $ACT, $ID, $conf, $lang;

if (is_null($id)) {
$title = (p_get_metadata($ID, 'title')) ?: $ID;
} else {
if (isset($id)) {
$title = (p_get_metadata($id, 'title')) ?: $id;
} else {
$title = (p_get_metadata($ID, 'title')) ?: $ID;
}

// default page title is the page name, modify with the current action
Expand Down

0 comments on commit 9df29ad

Please sign in to comment.