about summary refs log tree commit diff
path: root/page.php
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@gmail.com>2018-11-22 04:45:04 +0000
committerZach DeCook <zachdecook@gmail.com>2018-11-22 04:45:04 +0000
commitd034708620b528d08bc8c4750439f84de484bc4a (patch)
tree29a218141093f0e715b6356b562466705bf4e015 /page.php
parentc26de1b5b3fe74ed692659d15bae54fa1cac3753 (diff)
downloadprosongsa-d034708620b528d08bc8c4750439f84de484bc4a.tar.gz
-php:reduce errors
Diffstat (limited to 'page.php')
-rw-r--r--page.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/page.php b/page.php
index f890290..98fb3cf 100644
--- a/page.php
+++ b/page.php
@@ -82,9 +82,9 @@ function tocentry( $item ){
 		$class = 'incomplete';
 	}
 	$output = "<li class='$class'><a href=?song=$item[number]>$item[number]. $item[title]</a>";
-	if ( $item['author'] ){ $output .= "($item[author])";}
-	if ( $item['verse'] ){ $output .= "($item[verse])"; }
-	if ( $item['key'] ){ $output .= "($item[key])"; }
+	if ( !empty($item['author']) ){ $output .= "($item[author])";}
+	if ( $item['verse'] ?? false ){ $output .= "($item[verse])"; }
+	if ( $item['key'] ?? false){ $output .= "($item[key])"; }
 
 	return $output;
 }
@@ -269,7 +269,7 @@ function renderSS( $suggestedSong = array(), $songKeys, $transp )
 	$bs = array();// "bad" songs. Songs without transpositions.
 	//shuffle( $suggestedSong );
 	foreach ($suggestedSong as $songNum => $songarray) {
-		$title = $songarray['title'] . ($songarray['author'] ? "($songarray[author])" :  '');
+		$title = $songarray['title'] . (!empty($songarray['author']) ? "($songarray[author])" :  '');
 		if( isset($songarray['key']) )
 		{
 			$ok = trim($songarray['key'], 'm');