From 36f2d7c159dca3a958e96bb913d64c8768dc7518 Mon Sep 17 00:00:00 2001 From: Gina Haeussge Date: Sun, 12 Oct 2008 17:50:22 +0200 Subject: Make recognized URL schemes customizable via conf/scheme.conf (FS#797) darcs-hash:20081012155022-2b4f5-177571b9b176bb822015623b62b4d35b98a93d7b.gz --- inc/confutils.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'inc/confutils.php') diff --git a/inc/confutils.php b/inc/confutils.php index c18b92a02..d735b8b82 100644 --- a/inc/confutils.php +++ b/inc/confutils.php @@ -132,6 +132,21 @@ function getWordblocks() { } +function getSchemes() { + static $schemes = NULL; + if ( !$schemes ) { + $schemes = file(DOKU_CONF.'scheme.conf'); + if (@file_exists(DOKU_CONF.'scheme.local.conf')) { + $local = file(DOKU_CONF.'scheme.local.conf'); + $schemes = array_merge($schemes, $local); + } + } + $schemes = array_map('trim', $schemes); + $schemes = preg_replace('/^#.*/', '', $schemes); + $schemes = array_filter($schemes); + return $schemes; +} + /** * Builds a hash from a configfile * -- cgit v1.2.3