From: Even H. <ho...@us...> - 2005-03-30 14:41:09
|
Update of /cvsroot/tavi/tavi/parse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22872 Modified Files: macros.php transforms.php Log Message: Some beautification to avoid warnings Index: macros.php =================================================================== RCS file: /cvsroot/tavi/tavi/parse/macros.php,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- macros.php 1 Mar 2004 16:27:49 -0000 1.22 +++ macros.php 30 Mar 2005 14:40:39 -0000 1.23 @@ -158,7 +158,7 @@ // Check for CurlyOptions, and split them preg_match("/^(?:\s*{([^]]*)})?\s*(.*)$/", $args, $arg); - $options = split(',', $arg[1]); + $options = array_slice(split(',', $arg[1]), 1); $search = $arg[2]; // Defaults @@ -166,7 +166,11 @@ // Parse options foreach ($options as $opt) { - list($name, $value) = split('=', $opt); + if (preg_match('/=/', $opt) { + list($name, $value) = split('=', $opt); + } else { + $name = $opt; $value=''; + } $name=strtolower($name); if (preg_match("/^or/i", $name)) { // ORigin - Displays origin of wanted pages $displayOrigin = !($value == 'false'); @@ -245,15 +249,21 @@ // Check for CurlyOptions, and split them preg_match("/^(?:\s*{([^]]*)})?\s*(.*)$/", $args, $arg); - $options = split(',', $arg[1]); + $options = array_slice(split(',', $arg[1]), 1); $search = $arg[2]; // Some defaults $useDelim = ''; // Empty delimiter at the start, changed by options + $showIndex = false; + $text = ''; // Parse options foreach ($options as $opt) { - list($name, $value) = split('=', $opt); + if (preg_match('/=/', $opt)) { + list($name, $value) = split('=', $opt); + } else { + $name = $opt; $value = ''; + } $name=strtolower($name); if (preg_match("/^st/", $name)) { // STyle - Adds a style-attribute $style = $value; @@ -430,7 +440,7 @@ // Check for CurlyOptions, and split them preg_match("/^(?:\s*{([^]]*)})?\s*(.*)$/", $args, $arg); - $options = split(',', $arg[1]); + $options = array_slice(split(',', $arg[1]), 1); $page = $arg[2]; if(!validate_page($page)) @@ -457,7 +467,11 @@ // Check for CurlyOptions affecting transclusion // Parse options foreach ($options as $opt) { - list($name, $value) = split('=', $opt); + if (preg_match('/=/', $opt) { + list($name, $value) = split('=', $opt); + } else { + $name = $opt; $value=''; + } $name=strtolower($name); if ($name[0]=='o') { // Offset - Adds to header levels in transcluded docs $HeadingOffset = $previousHeadingOffset + (($value=='') ? 1 : $value); Index: transforms.php =================================================================== RCS file: /cvsroot/tavi/tavi/parse/transforms.php,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- transforms.php 29 Mar 2005 15:29:54 -0000 1.55 +++ transforms.php 30 Mar 2005 14:40:39 -0000 1.56 @@ -152,7 +152,7 @@ } // translate sub-page markup into a qualified wikiword - if ($link[0] == '/') + if (($link != '') and ($link[0] == '/')) { if (preg_match("|(.*)\\/[^\\/]*|", $ParseObject, $path)) { $link = $path[1] . $link; } |