Commit d4200e26 authored by Dries's avatar Dries
Browse files

- Patch #763850 by c960657: require_once() and drupal_get_path() inconsistencies.

parent 245454be
......@@ -4459,7 +4459,7 @@ function _drupal_bootstrap_full() {
require_once DRUPAL_ROOT . '/' . variable_get('path_inc', 'includes/path.inc');
require_once DRUPAL_ROOT . '/includes/theme.inc';
require_once DRUPAL_ROOT . '/includes/pager.inc';
require_once DRUPAL_ROOT . '/' . variable_get('menu_inc', '/includes/menu.inc');
require_once DRUPAL_ROOT . '/' . variable_get('menu_inc', 'includes/menu.inc');
require_once DRUPAL_ROOT . '/includes/tablesort.inc';
require_once DRUPAL_ROOT . '/includes/file.inc';
require_once DRUPAL_ROOT . '/includes/unicode.inc';
......
......@@ -1082,7 +1082,7 @@ function _install_select_profile($profiles) {
if (sizeof($profiles) == 1) {
$profile = array_pop($profiles);
// TODO: is this right?
require_once $profile->uri;
require_once DRUPAL_ROOT . '/' . $profile->uri;
return $profile->name;
}
else {
......
......@@ -547,7 +547,7 @@ function drupal_verify_profile($install_state) {
* functions can be made available while other modules are installed.
*/
function drupal_install_system() {
$system_path = dirname(drupal_get_filename('module', 'system', NULL));
$system_path = drupal_get_path('module', 'system');
require_once DRUPAL_ROOT . '/' . $system_path . '/system.install';
module_invoke('system', 'install');
......
......@@ -23,7 +23,7 @@ class GraphUnitTest extends DrupalUnitTestCase {
*/
function testDepthFirstSearch() {
// Provoke the inclusion of graph.inc.
require_once 'includes/graph.inc';
require_once DRUPAL_ROOT . '/includes/graph.inc';
// The sample graph used is:
// 1 --> 2 --> 3 5 ---> 6
......
......@@ -1330,7 +1330,7 @@ function system_modules_uninstall_confirm_form($storage) {
// Construct the hidden form elements and list items.
foreach (array_filter($storage['uninstall']) as $module => $value) {
$info = drupal_parse_info_file(dirname(drupal_get_filename('module', $module)) . '/' . $module . '.info');
$info = drupal_parse_info_file(drupal_get_path('module', $module) . '/' . $module . '.info');
$uninstall[] = $info['name'];
$form['uninstall'][$module] = array('#type' => 'hidden',
'#value' => 1,
......
......@@ -53,8 +53,8 @@ public static function canUpdate($project_name) {
* Return available database schema updates one a new version is installed.
*/
public function getSchemaUpdates() {
require_once './includes/install.inc';
require_once './includes/update.inc';
require_once DRUPAL_ROOT . '/includes/install.inc';
require_once DRUPAL_ROOT . '/includes/update.inc';
if (_update_get_project_type($project) != 'module') {
return array();
......
......@@ -268,7 +268,7 @@ function update_access_allowed() {
// Calls to user_access() might fail during the Drupal 6 to 7 update process,
// so we fall back on requiring that the user be logged in as user #1.
try {
require_once drupal_get_path('module', 'user') . '/user.module';
require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';
return user_access('administer software updates');
}
catch (Exception $e) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment