about summary refs log tree commit diff
path: root/page.php
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@gmail.com>2018-04-18 11:42:14 -0400
committerZach DeCook <zachdecook@gmail.com>2018-04-18 11:42:14 -0400
commit895f7ae639b916287dee4184f3a2a4bdc8424e3e (patch)
tree84a6bde98861af7c14f97c9ad68fd88475f7fa0c /page.php
parent4a514b230f951a13efc9605b08c80d28e73837a6 (diff)
downloadprosongsa-895f7ae639b916287dee4184f3a2a4bdc8424e3e.tar.gz
* Server Code: Don't try to transpose stuff inside curly braces
Diffstat (limited to 'page.php')
-rw-r--r--page.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/page.php b/page.php
index 47f39d3..38d97ad 100644
--- a/page.php
+++ b/page.php
@@ -140,7 +140,7 @@ function load_song( $number, $transp = 0 )
 				}
 				$class = ! isset( $songKey ) ? "tabs chord$transp" : "tabs chord" . transpadd( $songKey, $transp );
 				$line = str_replace(
-					array('{','}'), 
+					array('{','}'),
 					array('</b>{', "}<b class='$class'>" ),
 					$line );
 
@@ -313,12 +313,15 @@ function z_transpose2( $line, $transp )
 	$newchords = z_transparray( $transp );
 	$newline = '';
 	$space = 0; ///@< Spaces that need to be added or removed.
+	$inCurly = 0;
 	for($i = 0; $i < strlen($line); $i++)
 	{
 		$char = $line[$i];
 		$nchar = isset($line[$i+1]) ? $line[$i+1] : '';
 		$upchar = strtoupper($line[$i]);
 		$cval = ord($upchar);
+		if ( $char == '}' && $inCurly ){ $inCurly = 0;}
+		if ( $char == '{' || $inCurly ){ $inCurly = 1; $newline .= $char; continue;}
 		// A-G
 		if( $cval <= 71 && $cval >=65 )
 		{