Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changing PATH_SEPARATOR - Fixing MDL-18474

  • Loading branch information...
commit 6e1f85a7a84d68d275dc3b9987cd7612babf1538 1 parent f9d9e0e
diml authored
View
18 search/add.php
@@ -20,24 +20,30 @@
*/
require_once('../config.php');
+ if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from the cron script
+ }
+
/// makes inclusions of the Zend Engine more reliable
- $separator = (array_key_exists('WINDIR', $_SERVER)) ? ';' : ':' ;
- ini_set('include_path', $CFG->dirroot.'/search'.$separator.ini_get('include_path'));
+ ini_set('include_path', $CFG->dirroot.PATH_SEPARATOR.'search'.PATH_SEPARATOR.ini_get('include_path'));
- require_once("$CFG->dirroot/search/lib.php");
- require_once("$CFG->dirroot/search/indexlib.php");
+ require_once($CFG->dirroot.'/search/lib.php');
+ require_once($CFG->dirroot.'/search/indexlib.php');
/// checks global search activation
- require_login();
+ // require_login();
if (empty($CFG->enableglobalsearch)) {
error(get_string('globalsearchdisabled', 'search'));
}
+ /*
+ Obsolete with the MOODLE INTERNAL check
if (!has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM))) {
error(get_string('beadmin', 'search'), "$CFG->wwwroot/login/index.php");
- }
+ }
+ */
/// check for php5 (lib.php)
View
20 search/delete.php
@@ -20,25 +20,31 @@
*/
require_once('../config.php');
-/// makes inclusions of the Zend Engine more reliable
- $separator = (array_key_exists('WINDIR', $_SERVER)) ? ';' : ':' ;
- ini_set('include_path', $CFG->dirroot.'/search'.$separator.ini_get('include_path'));
+ if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from the cron script
+ }
+
+/// makes inclusions of the Zend Engine more reliable
+ ini_set('include_path', $CFG->dirroot.PATH_SEPARATOR.'search'.PATH_SEPARATOR.ini_get('include_path'));
- require_once("$CFG->dirroot/search/lib.php");
- require_once("$CFG->dirroot/search/indexlib.php");
+ require_once($CFG->dirroot.'/search/lib.php');
+ require_once($CFG->dirroot.'/search/indexlib.php');
/// checks global search activation
- require_login();
+ // require_login();
if (empty($CFG->enableglobalsearch)) {
error(get_string('globalsearchdisabled', 'search'));
}
+ /*
+ Obsolete with the MOODLE INTERNAL check
if (!has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM))) {
error(get_string('beadmin', 'search'), "$CFG->wwwroot/login/index.php");
- } //if
+ }
+ */
try {
$index = new Zend_Search_Lucene(SEARCH_INDEX_PATH);
View
3  search/indexer.php
@@ -37,8 +37,7 @@
require_once("$CFG->dirroot/search/lib.php");
//require_once("debugging.php");
-$separator = (array_key_exists('WINDIR', $_SERVER)) ? ';' : ':' ;
- ini_set('include_path', $CFG->dirroot.'\search'.$separator.ini_get('include_path'));
+ ini_set('include_path', $CFG->dirroot.PATH_SEPARATOR.'search'.PATH_SEPARATOR.ini_get('include_path'));
/// only administrators can index the moodle installation, because access to all pages is required
View
3  search/indexersplash.php
@@ -21,8 +21,7 @@
require_once("{$CFG->dirroot}/search/lib.php");
/// makes inclusions of the Zend Engine more reliable
-$separator = (array_key_exists('WINDIR', $_SERVER)) ? ';' : ':' ;
-ini_set('include_path', $CFG->dirroot.'\search'.$separator.ini_get('include_path'));
+ini_set('include_path', $CFG->dirroot.PATH_SEPARATOR.'search'.PATH_SEPARATOR.ini_get('include_path'));
/// check global search is enabled
View
3  search/tests/index.php
@@ -14,8 +14,7 @@
require_once("$CFG->dirroot/search/lib.php");
/// makes inclusions of the Zend Engine more reliable
- $separator = (array_key_exists('WINDIR', $_SERVER)) ? ';' : ':' ;
- ini_set('include_path', $CFG->dirroot.'\search'.$separator.ini_get('include_path'));
+ ini_set('include_path', $CFG->dirroot.PATH_SEPARATOR.'search'.PATH_SEPARATOR.ini_get('include_path'));
require_login();
Please sign in to comment.
Something went wrong with that request. Please try again.