Commit c389c905 authored by Dries's avatar Dries

- Patch #144634 by chx: fixed critical bug that prevented language negotiation...

- Patch #144634 by chx: fixed critical bug that prevented language negotiation to work after/when drupal_goto() is called.
parent ec75cf33
......@@ -90,7 +90,7 @@ DirectoryIndex index.php
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /
......
......@@ -12,7 +12,7 @@ Drupal 6.0, xxxx-xx-xx (development version)
default in the default install profile.
* Extended the database log module so log messages can be filtered.
* Added syslog module: useful for monitoring large Drupal installations.
- Added optional e-mail notifications when users are approved, blocked, or
- Added optional e-mail notifications when users are approved, blocked, or
deleted.
- Added versioning support to categories by associating them with node
revisions.
......
......@@ -54,7 +54,7 @@ INSTALLATION
your web server's document root or your public HTML directory:
mv drupal-x.x/* drupal-x.x/.htaccess /var/www/html
If you would like to have the default English interface translated to a
different language, we have good news. You can install and use Drupal in
other languages from the start. Check whether a released package of the
......@@ -69,7 +69,7 @@ INSTALLATION
the details you provide through the install process, in the same
directory. For Drupal to be able to create the file, you need to
give the web server write privileges to the sites/default directory:
chmod o+w default
3. CREATE THE DRUPAL DATABASE
......@@ -90,7 +90,7 @@ INSTALLATION
To run the install script point your browser to the base url of your website
(i.e. http://www.example.com).
You will be guided through several screens to set up the database,
create tables, add the first user account and provide basic web
site settings.
......
......@@ -311,8 +311,8 @@ function drupal_goto($path = '', $query = NULL, $fragment = NULL, $http_response
// data will be written to the database before the header is sent to the
// browser.
register_shutdown_function('header', "Location: $url", TRUE, $http_response_code);
// Make sure none of the code below the drupal_goto() call gets executed.
// Make sure none of the code below the drupal_goto() call gets executed.
exit();
}
......@@ -1197,6 +1197,8 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL
* as in an RSS feed.
* 'alias' (default FALSE)
* Whether the given path is an alias already.
* 'external'
* Whether the given path is an external URL.
* @return
* a string containing a URL to the given path.
*
......@@ -1206,11 +1208,17 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL
function url($path = NULL, $options = array()) {
// Merge in defaults
$options += array(
'fragment' => '',
'query' => '',
'absolute' => FALSE,
'alias' => FALSE,
);
'fragment' => '',
'query' => '',
'absolute' => FALSE,
'alias' => FALSE,
);
if (!isset($options['external'])) {
// Return an external link if $path contains an allowed absolute URL.
// Only call the slow filter_xss_bad_protocol if $path contains a ':' before any / ? or #.
$colonpos = strpos($path, ':');
$options['external'] = ($colonpos !== FALSE && !preg_match('![/?#]!', substr($path, 0, $colonpos)) && filter_xss_bad_protocol($path, FALSE) == check_plain($path));
}
// May need language dependant rewriting if language.inc is present
if (function_exists('language_url_rewrite')) {
......@@ -1223,10 +1231,7 @@ function url($path = NULL, $options = array()) {
$options['query'] = drupal_query_string_encode($options['query']);
}
// Return an external link if $path contains an allowed absolute URL.
// Only call the slow filter_xss_bad_protocol if $path contains a ':' before any / ? or #.
$colonpos = strpos($path, ':');
if ($colonpos !== FALSE && !preg_match('![/?#]!', substr($path, 0, $colonpos)) && filter_xss_bad_protocol($path, FALSE) == check_plain($path)) {
if ($options['external']) {
// Split off the fragment
if (strpos($path, '#') !== FALSE) {
list($path, $old_fragment) = explode('#', $path, 2);
......
......@@ -100,7 +100,7 @@ function language_url_rewrite(&$path, &$options) {
global $language;
// Only modify relative (insite) URLs.
if (!$options['absolute']) {
if (!$options['external']) {
// Language can be passed as an option, or we go for current language.
$path_language = isset($options['language']) ? $options['language'] : $language;
......
This diff is collapsed.
......@@ -27,11 +27,11 @@ function aggregator_page_source($arg1, $arg2 = NULL) {
$feed = (object)$feed;
drupal_set_title(check_plain($feed->title));
$feed_source = theme('aggregator_feed_source', $feed);
// It is safe to include the fid in the query because it's loaded from the
// database by aggregator_feed_load.
// database by aggregator_feed_load.
$items = aggregator_feed_items_load('SELECT * FROM {aggregator_item} WHERE fid = '. $feed->fid .' ORDER BY timestamp DESC, iid DESC');
return _aggregator_page_list($items, arg(3), $feed_source);
}
......@@ -46,16 +46,16 @@ function aggregator_page_category($arg1, $arg2 = NULL) {
drupal_add_feed(url('aggregator/rss/'. $category['cid']), variable_get('site_name', 'Drupal') .' '. t('aggregator - @title', array('@title' => $category['title'])));
// It is safe to include the cid in the query because it's loaded from the
// database by aggregator_category_load.
// database by aggregator_category_load.
$items = aggregator_feed_items_load('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_category_item} c LEFT JOIN {aggregator_item} i ON c.iid = i.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE cid = '. $category['cid'] .' ORDER BY timestamp DESC, i.iid DESC');
return _aggregator_page_list($items, arg(3));
}
/**
* Load feed items by passing a sql query.
*/
function aggregator_feed_items_load($sql) {
function aggregator_feed_items_load($sql) {
$items = array();
if (isset($sql)) {
$result = pager_query($sql, 20);
......@@ -82,7 +82,7 @@ function _aggregator_page_list($items, $op, $feed_source = '') {
}
else {
// Assemble themed output.
$output = $feed_source;
$output = $feed_source;
foreach ($items as $item) {
$output .= theme('aggregator_item', $item);
}
......@@ -106,7 +106,7 @@ function aggregator_categorize_items($items, $feed_source = '') {
$categories = array();
$done = FALSE;
$form['items'] = array();
$form['categories'] = array('#tree' => TRUE);
$form['categories'] = array('#tree' => TRUE);
foreach ($items as $item) {
$form['items'][$item->iid] = array('#value' => theme('aggregator_item', $item));
$form['categories'][$item->iid] = array();
......@@ -285,7 +285,7 @@ function aggregator_page_rss() {
$sql = 'SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_item} i INNER JOIN {aggregator_feed} f ON i.fid = f.fid ORDER BY i.timestamp DESC, i.iid DESC';
$result = db_query_range($sql, 0, variable_get('feed_default_items', 10));
}
while ($item = db_fetch_object($result)) {
$feeds[] = $item;
}
......@@ -347,11 +347,11 @@ function aggregator_page_opml($cid = NULL) {
else {
$result = db_query('SELECT * FROM {aggregator_feed} ORDER BY title');
}
while ($item = db_fetch_object($result)) {
$feeds[] = $item;
}
return theme('aggregator_page_opml', $feeds);
}
......@@ -429,7 +429,7 @@ function template_preprocess_aggregator_summary_item(&$variables) {
*/
function template_preprocess_aggregator_feed_source(&$variables) {
$feed = $variables['feed'];
$variables['source_icon'] = theme('feed_icon', $feed->url, t('!title feed', array('!title' => $feed->title)));
$variables['source_image'] = $feed->image;
$variables['source_description'] = aggregator_filter_xss($feed->description);
......
......@@ -25,9 +25,9 @@ function contact_site_page() {
function contact_mail_page() {
global $user;
$form = $categories = array();
$result = db_query('SELECT cid, category, selected FROM {contact} ORDER BY weight, category');
while ($category = db_fetch_object($result)) {
$categories[$category->cid] = $category->category;
......
......@@ -34,7 +34,7 @@ function user_admin($callback_arg = '') {
/**
* Form builder; Return form for user administration filters.
*
*
* @ingroup forms
* @see user_filter_form_submit().
*/
......@@ -486,7 +486,7 @@ function user_admin_settings() {
/**
* Menu callback: administer permissions.
*
*
* @ingroup forms
* @see user_admin_perm_submit().
* @see theme_user_admin_perm().
......@@ -611,7 +611,7 @@ function theme_user_admin_perm($form) {
/**
* Menu callback: administer roles.
*
*
* @ingroup forms
* @see user_admin_role_validate().
* @see user_admin_role_submit().
......@@ -859,7 +859,7 @@ function user_admin_access_check_submit($form, &$form_state) {
/**
* Menu callback: delete an access rule
*
*
* @ingroup forms
* @see user_admin_access_delete_confirm_submit().
*/
......@@ -904,7 +904,7 @@ function user_admin_access() {
/**
* Theme user administration overview.
*
*
* @ingroup themeable
*/
function theme_user_admin_account($form) {
......@@ -973,7 +973,7 @@ function theme_user_admin_new_role($form) {
/**
* Theme user administration filter form.
*
*
* @ingroup themeable
*/
function theme_user_filter_form($form) {
......@@ -986,7 +986,7 @@ function theme_user_filter_form($form) {
/**
* Theme user administration filter selector.
*
*
* @ingroup themeable
*/
function theme_user_filters($form) {
......
This diff is collapsed.
......@@ -835,7 +835,7 @@ fieldset {
*:first-child+html fieldset > .description, *:first-child+html fieldset .fieldset-wrapper .description {
padding-top: 1em;
}
fieldset legend {
/* Fix disappearing legend in FFox */
display: block;
......@@ -843,7 +843,7 @@ fieldset legend {
*:first-child+html fieldset legend, *:first-child+html fieldset.collapsed legend {
display: inline;
}
}
html.js fieldset.collapsed {
background: transparent;
......
......@@ -102,11 +102,11 @@ function phptemplate_node_submitted($node) {
*/
function phptemplate_get_ie_styles() {
global $language;
$iecss = '<link type="text/css" rel="stylesheet" media="all" href="'. base_path() . path_to_theme() .'/fix-ie.css" />';
if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) {
$iecss .= '<style type="text/css" media="all">@import "'. base_path() . path_to_theme() .'/fix-ie-rtl.css";</style>';
}
return $iecss;
}
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