diff --git a/check.php b/check.php index 7182bac..550f6db 100644 --- a/check.php +++ b/check.php @@ -30,7 +30,7 @@ class Check { $from_type = $page->type_info($from); $type = $from_type['type']; if ($type !== null) { - $href .= "&from=" . lcfirst($from_type['title']); + $href .= "&from=" . Page::lc_first($from_type['title']); } echo "
"; diff --git a/history.php b/history.php index baf372a..3488e56 100644 --- a/history.php +++ b/history.php @@ -95,7 +95,7 @@ if (isset($_GET['from'])) { $info = $page->type_info($_GET['from']); if ($info['type'] !== null) { $from_title = $info['title']; - $from = lcfirst($from_title); + $from = Page::lc_first($from_title); $from_href = "$from.php"; } } diff --git a/inc/page.php b/inc/page.php index 082b3f2..f012e88 100644 --- a/inc/page.php +++ b/inc/page.php @@ -390,4 +390,14 @@ class Page { echo ""; } } + + /** + * lcfirst is only supported in PHP >= 5.3 + * @param $str + * @return string + */ + static function lc_first($str) { + $str[0] = strtolower($str[0]); + return (string)$str; + } }