From: tokul Date: Thu, 3 Feb 2005 14:26:58 +0000 (+0000) Subject: should fix one #1105760 issue. (old config file and $data_dir, that X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e4a468a78b04cf18a3d1fe9478eb36f9a76175df;p=squirrelmail.git should fix one #1105760 issue. (old config file and $data_dir, that does not have trailing slash). Problems with full path might be related to user config. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8758 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/ChangeLog b/ChangeLog index cdf979f7..d593af2a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -202,6 +202,8 @@ Version 1.5.1 -- CVS - Move default_pref to the config/ dir, but keep checking legacy locations first for bc. Do not fail with an error when default_pref not found, just create an empty one. + - Add trailing slash for data directory used by global file based address + book (#1105760). Version 1.5.0 -------------------- diff --git a/functions/addressbook.php b/functions/addressbook.php index 05ecc91a..b4a31a36 100644 --- a/functions/addressbook.php +++ b/functions/addressbook.php @@ -61,8 +61,13 @@ function addressbook_init($showerr = true, $onlylocal = false) { && trim($abook_global_file)!=''){ // Detect place of address book if (! preg_match("/[\/\\\]/",$abook_global_file)) { - // no path chars - $abook_global_filename=$data_dir . $abook_global_file; + /* no path chars, address book stored in data directory + * make sure that there is a slash between data directory + * and address book file name + */ + $abook_global_filename=$data_dir + . ((substr($data_dir, -1) != '/') ? '/' : '') + . $abook_global_file; } elseif (preg_match("/^\/|\w:/",$abook_global_file)) { // full path is set in options (starts with slash or x:) $abook_global_filename=$abook_global_file; @@ -98,6 +103,7 @@ function addressbook_init($showerr = true, $onlylocal = false) { * hook allows to include different address book backends. * plugins should extract $abook and $r from arguments * and use same add_backend commands as above functions. + * @since 1.5.1 */ $hookReturn = do_hook('abook_init', $abook, $r); $abook = $hookReturn[1]; @@ -896,6 +902,7 @@ if((isset($addrbook_dsn) && !empty($addrbook_dsn)) || * class must follow address book class coding standards. * * see addressbook_backend class and functions/abook_*.php files. + * @since 1.5.1 */ do_hook('abook_add_class');