Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv13176/lib
Modified Files:
stdlib.php
Log Message:
Fix broken switch statement (which cause my PHP to segfault ?!?)
Index: stdlib.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -r1.53 -r1.54
*** stdlib.php 2001/12/06 06:24:44 1.53
--- stdlib.php 2001/12/06 18:29:15 1.54
***************
*** 123,145 ****
$linktext);
} else {
! //ideally the link image would be specified by a map file
! //similar to the interwiki.map
! $linkproto = substr($url, 0, strrpos($url, ":"));
! switch($linkproto) {
! case "mailto":
! $linkimg = "/images/mailto.png";
! case "http":
! $linkimg = "/images/http.png";
! case "https":
! $linkimg = "/images/https.png";
! case "ftp":
! $linkimg = "/images/ftp.png";
! else
! $linkimg = "/images/http.png";
! }
return Element('a',
! array('href' => $url, 'class' => $class),
! Element('img', array('src' => DATA_PATH . $linkimg, 'alt' => $linkproto)) . $linktext);
! }
}
--- 123,152 ----
$linktext);
} else {
! //ideally the link image would be specified by a map file
! //similar to the interwiki.map
! $linkproto = substr($url, 0, strrpos($url, ":"));
! switch($linkproto) {
! case "mailto":
! $linkimg = "/images/mailto.png";
! break;
! case "http":
! $linkimg = "/images/http.png";
! break;
! case "https":
! $linkimg = "/images/https.png";
! break;
! case "ftp":
! $linkimg = "/images/ftp.png";
! break;
! default:
! $linkimg = "/images/http.png";
! break;
! }
return Element('a',
! array('href' => $url, 'class' => $class),
! Element('img', array('src' => DATA_PATH . $linkimg,
! 'alt' => $linkproto))
! . $linktext);
! }
}
***************
*** 386,394 ****
$link['type'] = "url-$linktype";
$link['link'] = LinkURL($URL, $linkname);
-
-
- $link['link'] = LinkURL($URL, $linkname);
-
-
}
} elseif (preg_match("#^phpwiki:(.*)#", $URL, $match)) {
--- 393,396 ----
|