Added hook for Preferences Backend to resolve potential file inclusions
authorcigamit <cigamit@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 14 Jan 2005 06:16:22 +0000 (06:16 +0000)
committercigamit <cigamit@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 14 Jan 2005 06:16:22 +0000 (06:16 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8647 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
doc/plugin.txt
functions/prefs.php

index 927054ec110d3e38ea71c929c21f9ff28b5e611d..0b0f5ea4f5150e0651bbcd0f9ffc6ee6e825a10a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -175,6 +175,8 @@ Version 1.5.1 -- CVS
     links, and return to message page that originally called from.
   - Max upload file size now correctly handles a '-1' value, meaning
     unlimited (#1094569). 
+  - Security: Added hook for Preferences Backend to resolve potential
+    file inclusions
 
 Version 1.5.0
 --------------------
index 8f4d76d76db311fd9de9375a5c325108ecdc6667..ddbfc21a884cabf36ae647f0f063c2bb62c12be3 100644 (file)
@@ -294,6 +294,7 @@ but may be out of date soon thereafter.  You never know.  ;-)
   decode_body                    functions/mime.php              hook_func
   generic_header                 functions/page_header.php       do_hook
   menuline                       functions/page_header.php       do_hook
+  prefs_backend                  functions/prefs.php             hook_func
   loading_prefs                  include/load_prefs.php          do_hook
   addrbook_html_search_below     src/addrbook_search_html.php    do_hook
   addressbook_bottom             src/addressbook.php             do_hook
index 92f6f43dce4eb63a994fceffd7331053b4a031e5..fb1c0c38c03c302ad9a572e0b028bb15b274401f 100644 (file)
@@ -14,6 +14,7 @@
 
 /** Include global.php */
 require_once(SM_PATH . 'functions/global.php');
+require_once(SM_PATH . 'functions/plugin.php');
 
 sqgetGlobalVar('prefs_cache', $prefs_cache, SQ_SESSION );
 sqgetGlobalVar('prefs_are_cached', $prefs_are_cached, SQ_SESSION );
@@ -26,7 +27,8 @@ if ( !sqsession_is_registered('prefs_are_cached') ||
     $prefs_cache = array();
 }
 
-if (isset($prefs_backend) && file_exists(SM_PATH . $prefs_backend)) {
+$prefs_backend = do_hook_function('prefs_backend');
+if (isset($prefs_backend) && !empty($prefs_backend) && file_exists(SM_PATH . $prefs_backend)) {
     require_once(SM_PATH . $prefs_backend);
 } elseif (isset($prefs_dsn) && !empty($prefs_dsn)) {
     require_once(SM_PATH . 'functions/db_prefs.php');