head 1.41; access; symbols; locks; strict; comment @# @; 1.41 date 2009.09.19.06.56.47; author rse; state Exp; branches; next 1.40; commitid b7bM64yPN7JY1g4u; 1.40 date 2009.06.08.17.25.45; author rse; state Exp; branches; next 1.39; commitid 2lkIu6QgWba1P4Rt; 1.39 date 2009.06.05.22.05.36; author rse; state Exp; branches; next 1.38; commitid 5uFkO8fQf89ZsIQt; 1.38 date 2009.05.17.11.09.13; author rse; state Exp; branches; next 1.37; commitid qqSverctNZDGrdOt; 1.37 date 2009.05.11.20.30.19; author rse; state Exp; branches; next 1.36; commitid pH5az1jxCjj8KuNt; 1.36 date 2009.04.19.08.14.49; author rse; state Exp; branches; next 1.35; commitid sXBF4WJlu4UEnBKt; 1.35 date 2008.12.11.07.10.07; author rse; state Exp; branches; next 1.34; commitid cxFDHHfFTBsxa1ut; 1.34 date 2008.10.17.18.20.51; author rse; state Exp; branches; next 1.33; commitid hnwhLLvsYh8gE0nt; 1.33 date 2008.10.15.18.04.40; author rse; state Exp; branches; next 1.32; commitid NvycOB63dtXGCKmt; 1.32 date 2008.10.11.07.18.03; author rse; state Exp; branches; next 1.31; commitid L4txOWQLRuoPabmt; 1.31 date 2008.09.01.08.56.39; author rse; state Exp; branches; next 1.30; commitid mHGJSn9pMokn03ht; 1.30 date 2008.08.25.15.27.38; author rse; state Exp; branches; next 1.29; commitid w4zSLeVeAYBsobgt; 1.29 date 2008.08.16.18.26.08; author rse; state Exp; branches; next 1.28; commitid fXg5XoXn1ojDF2ft; 1.28 date 2008.07.29.19.23.45; author rse; state Exp; branches; next 1.27; commitid IouLGzKIG5GgzJct; 1.27 date 2008.06.26.18.27.23; author rse; state Exp; branches; next 1.26; commitid ALKEW5TvOFhHju8t; 1.26 date 2008.06.26.15.52.26; author rse; state Exp; branches; next 1.25; commitid Itq9dMLuLBrxst8t; 1.25 date 2008.06.18.16.03.06; author rse; state Exp; branches; next 1.24; commitid CysDkhX7lh57Mr7t; 1.24 date 2008.06.16.16.11.13; author rse; state Exp; branches; next 1.23; commitid T0OjTggoXdiUSb7t; 1.23 date 2008.06.14.14.26.34; author rse; state Exp; branches; next 1.22; commitid ic4BzgRaxZIZmV6t; 1.22 date 2008.06.14.14.01.05; author rse; state Exp; branches; next 1.21; commitid MK0KWzcpS2TfeV6t; 1.21 date 2008.06.14.13.14.46; author rse; state Exp; branches; next 1.20; commitid DeovCpiTeIBmYU6t; 1.20 date 2008.05.30.19.18.50; author rse; state Exp; branches; next 1.19; commitid eCNu1owuEJP9t15t; 1.19 date 2008.05.29.11.13.43; author rse; state Exp; branches; next 1.18; commitid Icjk0fptGzQIOQ4t; 1.18 date 2008.05.29.10.12.36; author rse; state Exp; branches; next 1.17; commitid KvboRONbGDZKtQ4t; 1.17 date 2008.05.29.06.29.42; author rse; state Exp; branches; next 1.16; commitid FxSVGkHpN72ifP4t; 1.16 date 2008.05.28.18.59.11; author rse; state Exp; branches; next 1.15; commitid 2Z9fSq4hLjsoqL4t; 1.15 date 2008.05.23.18.26.23; author rse; state Exp; branches; next 1.14; commitid 9TMOP6V4FY47p74t; 1.14 date 2008.05.23.16.58.41; author rse; state Exp; branches; next 1.13; commitid dsvJQk2dTEw1V64t; 1.13 date 2008.05.23.16.28.33; author rse; state Exp; branches; next 1.12; commitid WuV3FL9TpCIGK64t; 1.12 date 2008.05.23.15.11.55; author rse; state Exp; branches; next 1.11; commitid S9fbNIGt6IMok64t; 1.11 date 2008.05.23.09.27.18; author rse; state Exp; branches; next 1.10; commitid rbnlNypagRYaq44t; 1.10 date 2008.05.23.08.44.10; author rse; state Exp; branches; next 1.9; commitid QNjaV7vYQGonb44t; 1.9 date 2008.05.16.18.12.17; author rse; state Exp; branches; next 1.8; commitid ufBvXLoGS0seyd3t; 1.8 date 2008.05.09.12.12.24; author rse; state Exp; branches; next 1.7; commitid wKI1rjLEBkfIMh2t; 1.7 date 2008.05.03.08.46.37; author rse; state Exp; branches; next 1.6; commitid coou3JHlJeD4Qu1t; 1.6 date 2008.05.02.21.16.00; author rse; state Exp; branches; next 1.5; commitid DLfq2RdSxgb91r1t; 1.5 date 2008.05.02.19.17.58; author rse; state Exp; branches; next 1.4; commitid IDOlmv3gzd3Fmq1t; 1.4 date 2008.05.02.19.03.06; author rse; state Exp; branches; next 1.3; commitid bKF84tk0Qhtyhq1t; 1.3 date 2008.04.24.09.46.44; author rse; state Exp; branches; next 1.2; commitid B53GiZBOsa0Dsl0t; 1.2 date 2008.04.09.18.49.46; author rse; state Exp; branches; next 1.1; commitid vrtlQ7uGCFuNWsYs; 1.1 date 2007.07.06.20.40.42; author thl; state Exp; branches; next ; commitid l3Cq0r6QfK7UuKos; desc @@ 1.41 log @upgrading package: drupal 6.13 -> 6.14 @ text @Fix Reverse Proxy Support: http://drupal.org/node/244593 http://drupal.org/files/issues/drupal_80.patch Index: includes/bootstrap.inc --- includes/bootstrap.inc.orig 2008-02-11 15:36:21 +0100 +++ includes/bootstrap.inc 2008-04-09 20:47:49 +0200 @@@@ -272,6 +272,7 @@@@ */ function conf_init() { global $base_url, $base_path, $base_root; + global $base_url_local; // Export the following settings.php variables to the global namespace global $db_url, $db_prefix, $cookie_domain, $conf, $installed_profile, $update_free_access; @@@@ -723,9 +724,22 @@@@ * generate an equivalent using other environment variables. */ function request_uri() { + global $base_url; + global $base_url_local; if (isset($_SERVER['REQUEST_URI'])) { $uri = $_SERVER['REQUEST_URI']; + if (isset($base_url) && isset($base_url_local)) { + $parts = parse_url($base_url_local); + if ( strlen($uri) >= strlen($base_url_local) + && substr($uri, 0, strlen($base_url_local)) == $base_url_local) { + $uri = $base_url . substr($uri, strlen($base_url_local)); + } + elseif ( strlen($uri) >= strlen($parts["path"]) + && substr($uri, 0, strlen($parts["path"])) == $parts["path"]) { + $uri = $base_url . substr($uri, strlen($parts["path"])); + } + } } else { if (isset($_SERVER['argv'])) { @@@@ -792,6 +806,7 @@@@ } } // Prevent multiple slashes to avoid cross site requests via the FAPI. + if (substr($uri, 0, 1) == "/") $uri = '/'. ltrim($uri, '/'); return $uri; Index: sites/default/default.settings.php --- sites/default/default.settings.php.orig 2007-12-20 10:35:10 +0100 +++ sites/default/default.settings.php 2008-04-09 20:47:32 +0200 @@@@ -126,6 +126,24 @@@@ # $base_url = 'http://www.example.com'; // NO trailing slash! /** + * Local Base URL (optional). + * + * If you are running Drupal behind a reverse proxy, $base_url (see above) + * usually points to the URL of the reverse proxy. Drupal uses this for + * all sorts of external URLs. In order to correctly calculate sub-URLs + * below $base_url for embedded HTML forms, Drupal also has to know the + * URL on the local/origin server under which Drupal is contacted by the + * reverse proxy. This is what $base_url_local is for. + * + * Examples: + * $base_url_local = 'http://www.example.com:8080/drupal'; + * + * It is not allowed to have a trailing slash; Drupal will add it + * for you. + */ +# $base_url_local = 'http://www.example.com:8080/drupal'; // NO trailing slash! + +/** * PHP settings: * * To see what PHP settings are possible, including whether they can ----------------------------------------------------------------------------- 1. Support HTTP Proxies (mainly for update checks, RSS fetching, etc) http://drupal.org/node/7881 http://drupal.org/files/issues/proxy_11.patch (post-adjusted and improved by RSE) 2. Fix CSS Cache Building Procedure http://drupal.org/node/275381 http://drupal.org/files/issues/drupal-css-cache-building.patch (created by RSE) Index: includes/common.inc --- includes/common.inc.orig 2008-04-09 23:11:44 +0200 +++ includes/common.inc 2008-06-26 20:16:16 +0200 @@@@ -439,13 +439,27 @@@@ case 'http': $port = isset($uri['port']) ? $uri['port'] : 80; $host = $uri['host'] . ($port != 80 ? ':'. $port : ''); - $fp = @@fsockopen($uri['host'], $port, $errno, $errstr, 15); + if (variable_get('proxy_server', '') != '') { + $proxy_server = variable_get('proxy_server', ''); + $proxy_port = variable_get('proxy_port', 8080); + $fp = @@fsockopen($proxy_server, $proxy_port, $errno, $errstr, 15); + } + else { + $fp = @@fsockopen($uri['host'], $port, $errno, $errstr, 15); + } break; case 'https': // Note: Only works for PHP 4.3 compiled with OpenSSL. $port = isset($uri['port']) ? $uri['port'] : 443; $host = $uri['host'] . ($port != 443 ? ':'. $port : ''); - $fp = @@fsockopen('ssl://'. $uri['host'], $port, $errno, $errstr, 20); + if (variable_get('proxy_server', '') != '') { + $proxy_server = variable_get('proxy_server', ''); + $proxy_port = variable_get('proxy_port', 8080); + $fp = @@fsockopen($proxy_server, $proxy_port, $errno, $errstr, 15); + } + else { + $fp = @@fsockopen('ssl://'. $uri['host'], $port, $errno, $errstr, 20); + } break; default: $result->error = 'invalid schema '. $uri['scheme']; @@@@ -462,9 +476,14 @@@@ } // Construct the path to act on. - $path = isset($uri['path']) ? $uri['path'] : '/'; - if (isset($uri['query'])) { - $path .= '?'. $uri['query']; + if (variable_get('proxy_server', '') != '') { + $path = $url; + } + else { + $path = isset($uri['path']) ? $uri['path'] : '/'; + if (isset($uri['query'])) { + $path .= '?'. $uri['query']; + } } // Create HTTP request. @@@@ -482,6 +501,14 @@@@ $defaults['Authorization'] = 'Authorization: Basic '. base64_encode($uri['user'] . (!empty($uri['pass']) ? ":". $uri['pass'] : '')); } + // If the proxy server required a username then attempt to authenticate with it + if (variable_get('proxy_username', '') != '') { + $username = variable_get('proxy_username', ''); + $password = variable_get('proxy_password', ''); + $auth_string = base64_encode($username . ($password != '' ? ':'. $password : '')); + $defaults['Proxy-Authorization'] = 'Proxy-Authorization: Basic '. $auth_string ."\r\n"; + } + foreach ($headers as $header => $value) { $defaults[$header] = $header .': '. $value; } Index: modules/system/system.admin.inc --- modules/system/system.admin.inc.orig 2008-03-25 12:58:16 +0100 +++ modules/system/system.admin.inc 2008-04-24 11:43:07 +0200 @@@@ -1363,6 +1363,65 @@@@ } /** + * Form builder; Configure the site proxy settings. + * + * @@ingroup forms + * @@see system_settings_form() + */ +function system_proxy_settings() { + + $form['forward_proxy'] = array( + '#type' => 'fieldset', + '#title' => t('Forward proxy settings'), + '#description' => t('The proxy server used when Drupal needs to connect to other sites on the Internet.'), + ); + $form['forward_proxy']['proxy_server'] = array( + '#type' => 'textfield', + '#title' => t('Proxy host name'), + '#default_value' => variable_get('proxy_server', ''), + '#description' => t('The host name of the proxy server, eg. localhost. If this is empty Drupal will connect directly to the internet.') + ); + $form['forward_proxy']['proxy_port'] = array( + '#type' => 'textfield', + '#title' => t('Proxy port number'), + '#default_value' => variable_get('proxy_port', 8080), + '#description' => t('The port number of the proxy server, eg. 8080'), + ); + $form['forward_proxy']['proxy_username'] = array( + '#type' => 'textfield', + '#title' => t('Proxy username'), + '#default_value' => variable_get('proxy_username', ''), + '#description' => t('The username used to authenticate with the proxy server.'), + ); + $form['forward_proxy']['proxy_password'] = array( + '#type' => 'textfield', + '#title' => t('Proxy password'), + '#default_value' => variable_get('proxy_password', ''), + '#description' => t('The password used to connect to the proxy server. This is kept as plain text.', '') + ); + $form['#validate'][] = 'system_proxy_settings_validate'; + + return system_settings_form($form); +} + +/** + * Validate the submitted proxy form. + */ +function system_proxy_settings_validate($form, &$form_state) { + // Validate the proxy settings + $form_state['values']['proxy_server'] = trim($form_state['values']['proxy_server']); + if ($form_state['values']['proxy_server'] != '') { + // TCP allows the port to be between 0 and 65536 inclusive + if (!is_numeric($form_state['values']['proxy_port'])) { + form_set_error('proxy_port', t('The proxy port is invalid. It must be a number between 0 and 65535.')); + } + elseif ($form_state['values']['proxy_port'] < 0 || $form_state['values']['proxy_port'] >= 65536) { + form_set_error('proxy_port', t('The proxy port is invalid. It must be between 0 and 65535.')); + } + } +} + +/** * Form builder; Configure the site file handling. * * @@ingroup forms Index: modules/system/system.module --- modules/system/system.module.orig 2008-04-09 23:11:49 +0200 +++ modules/system/system.module 2008-04-24 11:43:47 +0200 @@@@ -55,7 +55,7 @@@@ $output .= '
'. t('For more information, see the online handbook entry for System module.', array('@@system' => 'http://drupal.org/handbook/modules/system/')) .'
'; return $output; case 'admin': @@@@ -406,6 +406,14 @@@@ 'access arguments' => array('administer site configuration'), 'file' => 'system.admin.inc', ); + $items['admin/settings/proxy'] = array( + 'title' => 'Proxy server', + 'description' => 'Configure settings when the site is behind a proxy server.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('system_proxy_settings'), + 'access arguments' => array('administer site configuration'), + 'file' => 'system.admin.inc', + ); $items['admin/settings/file-system'] = array( 'title' => 'File system', 'description' => 'Tell Drupal where to store uploaded files and how they are accessed.', ----------------------------------------------------------------------------- Disable "Update notifications" check by default during installation. Index: install.php --- install.php.orig 2008-02-08 23:00:45 +0100 +++ install.php 2008-05-09 13:18:09 +0200 @@@@ -1069,7 +1069,7 @@@@ '#type' => 'checkboxes', '#title' => st('Update notifications'), '#options' => array(1 => st('Check for updates automatically')), - '#default_value' => array(1), + '#default_value' => array(), '#description' => st('With this option enabled, Drupal will notify you when new releases are available. This will significantly enhance your site\'s security and is highly recommended. This requires your site to periodically send anonymous information on its installed components to drupal.org. For more information please see the update notification information.', array('@@drupal' => 'http://drupal.org', '@@update' => 'http://drupal.org/handbook/modules/update')), '#weight' => 15, ); ----------------------------------------------------------------------------- No need to always expand the "Menu settings" on node edit pages. Index: modules/menu/menu.module --- modules/menu/menu.module.orig 2008-04-09 23:11:48 +0200 +++ modules/menu/menu.module 2008-05-16 20:03:48 +0200 @@@@ -366,7 +366,7 @@@@ '#title' => t('Menu settings'), '#access' => user_access('administer menu'), '#collapsible' => TRUE, - '#collapsed' => FALSE, + '#collapsed' => TRUE, '#tree' => TRUE, '#weight' => -2, '#attributes' => array('class' => 'menu-item-form'), ----------------------------------------------------------------------------- Use a larger text-area on node edit pages. Index: modules/node/node.pages.inc --- modules/node/node.pages.inc.orig 2008-02-27 20:44:44 +0100 +++ modules/node/node.pages.inc 2008-05-16 20:06:45 +0200 @@@@ -287,7 +287,8 @@@@ '#type' => 'textarea', '#title' => check_plain($label), '#default_value' => $include ? $node->body : ($node->teaser . $node->body), - '#rows' => 20, + '#rows' => 30, + '#cols' => 80, '#required' => ($word_count > 0), ); ----------------------------------------------------------------------------- Avoid incorrect ordering of BLOG entries by removing the db_rewrite_sql() calls which seem to introduce a wrong ordering. Index: modules/blog/blog.module --- modules/blog/blog.module.orig 2008-05-19 09:27:35 +0200 +++ modules/blog/blog.module 2008-07-29 21:20:42 +0200 @@@@ -182,13 +182,13 @@@@ * Helper function to determine if a user has blog posts already. */ function _blog_post_exists($account) { - return (bool)db_result(db_query_range(db_rewrite_sql("SELECT 1 FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1"), $account->uid, 0, 1)); + return (bool)db_result(db_query_range("SELECT 1 FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1", $account->uid, 0, 1)); } /** * Implementation of hook_block(). * - * Displays the most recent 10 blog titles. + * Displays the most recent 5 blog titles. */ function blog_block($op = 'list', $delta = 0) { global $user; @@@@ -198,7 +198,7 @@@@ } else if ($op == 'view') { if (user_access('access content')) { - $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, 10); + $result = db_query_range("SELECT n.nid, n.title, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC", 0, 5); if ($node_title_list = node_title_list($result)) { $block['content'] = $node_title_list; $block['content'] .= theme('more_link', url('blog'), t('Read the latest blog entries.')); Index: modules/blog/blog.pages.inc --- modules/blog/blog.pages.inc.orig 2009-09-14 17:08:00 +0200 +++ modules/blog/blog.pages.inc 2009-09-19 08:53:18 +0200 @@@@ -25,7 +25,7 @@@@ $output = theme('item_list', $items); - $result = pager_query(db_rewrite_sql("SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10), 0, NULL, $account->uid); + $result = pager_query("SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC", variable_get('default_nodes_main', 10), 0, NULL, $account->uid); $has_posts = FALSE; while ($node = db_fetch_object($result)) { @@@@ -64,7 +64,7 @@@@ $output = theme('item_list', $items); - $result = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10)); + $result = pager_query("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC", variable_get('default_nodes_main', 10)); $has_posts = FALSE; while ($node = db_fetch_object($result)) { @@@@ -87,7 +87,7 @@@@ * Menu callback; displays an RSS feed containing recent blog entries of a given user. */ function blog_feed_user($account) { - $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.created DESC"), $account->uid, 0, variable_get('feed_default_items', 10)); + $result = db_query_range("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.created DESC", $account->uid, 0, variable_get('feed_default_items', 10)); $channel['title'] = t("!name's blog", array('!name' => $account->name)); $channel['link'] = url('blog/'. $account->uid, array('absolute' => TRUE)); @@@@ -102,7 +102,7 @@@@ * Menu callback; displays an RSS feed containing recent blog entries of all users. */ function blog_feed_last() { - $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, variable_get('feed_default_items', 10)); + $result = db_query_range("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC", 0, variable_get('feed_default_items', 10)); $channel['title'] = t('!site_name blogs', array('!site_name' => variable_get('site_name', 'Drupal'))); $channel['link'] = url('blog', array('absolute' => TRUE)); @ 1.40 log @factor out Drupal add-on modules into own package @ text @d336 2 a337 2 --- modules/blog/blog.pages.inc.orig 2008-02-08 22:15:12 +0100 +++ modules/blog/blog.pages.inc 2008-06-26 17:19:49 +0200 d362 1 a362 1 $channel['title'] = $account->name ."'s blog"; d371 1 a371 1 $channel['title'] = variable_get('site_name', 'Drupal') .' blogs'; @ 1.39 log @get rid of most old -dev modules and upgrade many non release-versions, too @ text @a252 18 Activate the Drupal glue code for the FCKeditor filemanager. Index: sites/all/modules/fckeditor/fckeditor/editor/filemanager/connectors/php/config.php --- sites/all/modules/fckeditor/fckeditor/editor/filemanager/connectors/php/config.php.orig 2008-03-25 16:28:24 +0100 +++ sites/all/modules/fckeditor/fckeditor/editor/filemanager/connectors/php/config.php 2008-05-02 23:02:23 +0200 @@@@ -39,6 +39,9 @@@@ // Attention: The above 'UserFilesPath' must point to the same directory. $Config['UserFilesAbsolutePath'] = '' ; +// activate Drupal glue code for filemanager +require_once "../../../../../filemanager.config.php"; + // Due to security issues with Apache modules, it is recommended to leave the // following setting enabled. $Config['ForceSingleExtension'] = true ; ----------------------------------------------------------------------------- a303 265 1. Fix content validation in "xmlcontent" module in case one has enabled multiple filters on a particular input format. 2. Additionally, allow absolute paths to support .xsd/.xsl files in arbitrary directories. 3. Finally, do not create a new DOM and output it as XML. Instead directly output the transformed XML in order to get rid of the declaration. 4. Additionally, support an optional XML content template (mainly for loading ENTITY definitions which cannot be done via XSD and XSLT) Index: sites/all/modules/xmlcontent/xmlcontent.module --- sites/all/modules/xmlcontent/xmlcontent.module.orig 2007-03-14 22:59:59 +0100 +++ sites/all/modules/xmlcontent/xmlcontent.module 2008-05-30 21:13:16 +0200 @@@@ -39,8 +39,22 @@@@ return t('Allows users to post XML node content and get it transformed through a configured XSLT script'); case 'process': - $xslt_path = drupal_get_path('module', 'xmlcontent'). '/' . variable_get("xmlcontent_xslt_path_$format", ''); - return _xmlcontent_transform($text, $xslt_path); + $tpl_path = variable_get("xmlcontent_tpl_path_$format", ''); + if ($tpl_path) { + if (substr($tpl_path, 0, 1) != "/") + $tpl_path = drupal_get_path('module', 'xmlcontent') . '/' . $tpl_path; + $tpl = file_get_contents($tpl_path); + $text = preg_replace("/&template_body;/", $text, $tpl); + $cwd = getcwd(); + chdir(preg_replace("/\\/[^\\/]+\$/", "", $tpl_path)); + } + $xslt_path = variable_get("xmlcontent_xslt_path_$format", ''); + if (substr($xslt_path, 0, 1) != "/") + $xslt_path = drupal_get_path('module', 'xmlcontent') . '/' . $xslt_path; + $result = _xmlcontent_transform($text, $xslt_path); + if ($tpl_path) + chdir($cwd); + return $result; case 'settings': return _xmlcontent_filter_settings($format); @@@@ -72,7 +86,7 @@@@ } // Does the input format of this node use XML Content filter? $format = filter_resolve_format($node->format); - $module = db_result(db_query('SELECT module FROM {filters} WHERE format = %d', $format)); + $module = db_result(db_query("SELECT module FROM {filters} WHERE format = %d AND module = 'xmlcontent'", $format)); if ($module != 'xmlcontent') { return; } @@@@ -83,7 +97,10 @@@@ return; } - $schema_path = drupal_get_path('module', 'xmlcontent'). '/' . variable_get("xmlcontent_schema_path_$format",''); + $schema_path = variable_get("xmlcontent_schema_path_$format", ''); + if (substr($schema_path, 0, 1) != "/") + $schema_path = drupal_get_path('module', 'xmlcontent') . '/' . $schema_path; + if (!is_file($schema_path) && ($validation == 'xsd' or $validation == 'rng')) { $schema_path = null; watchdog( 'xmlcontent', t('Validation required but no schema file'), WATCHDOG_WARNING ); @@@@ -93,7 +110,23 @@@@ libxml_clear_errors(); libxml_use_internal_errors(true); - if (!_xmlcontent_validate($node->body, $validation, $schema_path)) { + $text = $node->body; + $tpl_path = variable_get("xmlcontent_tpl_path_$format", ''); + if ($tpl_path) { + if (substr($tpl_path, 0, 1) != "/") + $tpl_path = drupal_get_path('module', 'xmlcontent') . '/' . $tpl_path; + $tpl = file_get_contents($tpl_path); + $text = preg_replace("/&template_body;/", $text, $tpl); + $cwd = getcwd(); + chdir(preg_replace("/\\/[^\\/]+\$/", "", $tpl_path)); + } + + $result = _xmlcontent_validate($text, $validation, $schema_path); + + if ($tpl_path) + chdir($cwd); + + if (!$result) { form_set_error('body', t('XML Content: Invalid XML') . libxml_errors_string()); } @@@@ -156,6 +189,13 @@@@ '#collapsible' => TRUE, '#collapsed' => FALSE, ); + $form['xmlcontent']["xmlcontent_tpl_path_$format"] = array( + '#type' => 'textfield', + '#title' => t('Optional XML Template File Path'), + '#default_value' => variable_get("xmlcontent_tpl_path_$format", ''), + '#field_prefix' => drupal_get_path('module', 'xmlcontent'). '/', + '#description' => t('The file path to the optional XML template, wrapper around the XML content before processing.'), + ); $form['xmlcontent']["xmlcontent_xslt_path_$format"] = array( '#type' => 'textfield', '#title' => t('XSLT Script File Path'), @@@@ -218,6 +258,8 @@@@ // Load the XML document $dom = new DomDocument('1.0', 'UTF-8'); + $dom->resolveExternals = true; + $dom->substituteEntities = true; $valid = $dom->loadXML($xml); if (!$valid) { watchdog('xmlcontent', "Invalid XML Content", WATCHDOG_WARNING); @@@@ -227,6 +269,8 @@@@ // Load the XSLT script // TODO: is there a way to cache it, or not necessary $xsl = new DomDocument('1.0', 'UTF-8'); + $xsl->resolveExternals = true; + $xsl->substituteEntities = true; $xsl->load($path_to_xslt); // Create the XSLT processor @@@@ -242,10 +286,8 @@@@ } // Transform - $newdom = $proc->transformToDoc($dom); - - // Return the output as XML text (in fact subset of XHTML, depending on the XSLT script) - return $newdom->saveXML(); + $xml = $proc->transformToXML($dom); + return $xml; } ----------------------------------------------------------------------------- Fix upgrading in "simplefeed" module if PostgreSQL is used. Fix modules as Drupal 6.2 does not provide db_num_rows() anymore. Index: sites/all/modules/simplefeed/simplefeed.install --- sites/all/modules/simplefeed/simplefeed.install.orig 2008-06-11 07:22:28 +0200 +++ sites/all/modules/simplefeed/simplefeed.install 2008-06-14 15:09:53 +0200 @@@@ -31,8 +31,17 @@@@ function simplefeed_update_2() { $ret = array(); - $ret[] = update_sql("ALTER TABLE {simplefeed_feed} DROP INDEX url"); - $ret[] = update_sql("ALTER TABLE {simplefeed_feed} CHANGE url url text"); + switch ($GLOBALS['db_type']) { + case 'mysql': + case 'mysqli': + $ret[] = update_sql("ALTER TABLE {simplefeed_feed} DROP INDEX url"); + $ret[] = update_sql("ALTER TABLE {simplefeed_feed} CHANGE url url text"); + break; + case 'pgsql': + $ret[] = update_sql("DROP INDEX {simplefeed_feed}_url_idx"); + $ret[] = update_sql("ALTER TABLE {simplefeed_feed} ALTER COLUMN url TYPE text"); + break; + } return $ret; } Index: sites/all/modules/simplefeed/simplefeed_item.install --- sites/all/modules/simplefeed/simplefeed_item.install.orig 2008-06-11 07:22:28 +0200 +++ sites/all/modules/simplefeed/simplefeed_item.install 2008-06-14 16:23:01 +0200 @@@@ -60,8 +62,18 @@@@ function simplefeed_item_update_3() { $ret = array(); - $ret[] = update_sql("ALTER TABLE {simplefeed_feed_item} CHANGE url url text"); - $ret[] = update_sql("ALTER TABLE {simplefeed_feed_item} CHANGE iid iid varchar(32) NOT NULL"); + switch ($GLOBALS['db_type']) { + case 'mysql': + case 'mysqli': + $ret[] = update_sql("ALTER TABLE {simplefeed_feed_item} CHANGE url url text"); + $ret[] = update_sql("ALTER TABLE {simplefeed_feed_item} CHANGE iid iid varchar(32) NOT NULL"); + break; + case 'pgsql': + $ret[] = update_sql("ALTER TABLE {simplefeed_feed_item} ALTER COLUMN url TYPE text"); + $ret[] = update_sql("ALTER TABLE {simplefeed_feed_item} ALTER COLUMN iid TYPE VARCHAR(32)"); + $ret[] = update_sql("ALTER TABLE {simplefeed_feed_item} ALTER COLUMN iid SET NOT NULL"); + break; + } return $ret; } ----------------------------------------------------------------------------- Fix helpers module for PostgreSQL usage. Index: sites/all/modules/helpers/helpers_database.module --- sites/all/modules/helpers/helpers_database.module.orig 2008-04-23 04:38:34 +0200 +++ sites/all/modules/helpers/helpers_database.module 2008-06-16 18:06:41 +0200 @@@@ -16,7 +16,7 @@@@ * * NOTE: This is open code - do not put a function declaration on it. */ - $db_types = array('mysql', 'mysqli', 'postgres'); + $db_types = array('mysql', 'mysqli', 'pgsql'); $dbtype = $GLOBALS['db_type']; if (in_array($dbtype, $db_types)) { // Using include because the site may not be using this so we don't want a fatal error. Index: sites/all/modules/helpers/includes/dra_pgsql.inc --- sites/all/modules/helpers/includes/dra_pgsql.inc.orig 2008-06-16 17:49:43 +0200 +++ sites/all/modules/helpers/includes/dra_pgsql.inc 2008-06-16 18:05:19 +0200 @@@@ -0,0 +1,40 @@@@ + value + * 2 columns 1st value => 2nd value + * 3 or more 1st value => array(2nd value, 3rd value, ...) + */ +function db_result_array($result) { + $array = array(); + while ($row = pg_fetch_array($result, NULL, PGSQL_NUM)) { + $y = count($row); + switch ($y) { + case 0: + drupal_set_message(t('Db_result_array found no columns in the result set.'), 'error'); + return false; + + case 1: + $array[$row[0]] = $row[0]; + break; + + case 2: + $array[$row[0]] = $row[1]; + break; + + default: + $array[$row[0]] = array_slice($row, 1); + break; + } + } + return $array; +} ----------------------------------------------------------------------------- Fix PostgreSQL usage. Index: sites/all/modules/nodeupdates/nodeupdates.install --- sites/all/modules/nodeupdates/nodeupdates.install.orig 2007-12-31 15:11:57 +0100 +++ sites/all/modules/nodeupdates/nodeupdates.install 2008-06-18 18:00:08 +0200 @@@@ -15,10 +15,10 @@@@ case 'pgsql': db_query("CREATE TABLE {nodeupdates} ( - nid integer(10) NOT NULL default '0', + nid integer NOT NULL default '0', title varchar(128) NOT NULL default '', - message longtext NOT NULL default '', - timestamp integer(11) NOT NULL default '0' + message text NOT NULL default '', + timestamp integer NOT NULL default '0' )"); break; } ----------------------------------------------------------------------------- a373 38 ----------------------------------------------------------------------------- No need in SWF player if no according media selected. http://drupal.org/node/437618http://drupal.org/node/437618 Index: sites/all/modules/shadowbox/shadowbox.module --- sites/all/modules/shadowbox/shadowbox.module.orig 2009-02-10 18:08:54 +0100 +++ sites/all/modules/shadowbox/shadowbox.module 2009-05-11 22:23:03 +0200 @@@@ -450,6 +450,7 @@@@ * Validate admin settings form inputs. */ function shadowbox_global_settings_validate($form, &$form_state) { + $flv_formats = array_values($form_state['values']['shadowbox_supported_flv']); $flv_player = $form_state['values']['shadowbox_flv_player']; $color = $form_state['values']['shadowbox_overlay_color']; $opacity = $form_state['values']['shadowbox_overlay_opacity']; @@@@ -462,13 +463,15 @@@@ $initial_width = $form_state['values']['shadowbox_initial_width']; $counter_limit = $form_state['values']['shadowbox_counter_limit']; - if (!preg_match('!^([a-z0-9_\-\.]+/)*[a-z0-9_\-]+\.swf$!i', $flv_player)) { - form_set_error('shadowbox_flv_player', t('You must enter a valid path to an SWF Flash Player in the formflvplayer.swf.'));
+ if( sizeof(array_intersect($flv_formats, shadowbox_get_types('flv'))) != 0){
+ if (!preg_match('!^([a-z0-9_\-\.]+/)*[a-z0-9_\-]+\.swf$!i', $flv_player)) {
+ form_set_error('shadowbox_flv_player', t('You must enter a valid path to an SWF Flash Player in the form flvplayer.swf.'));
+ }
+ elseif (!file_exists($flv_player)) {
+ form_set_error('shadowbox_flv_player', t('The FLV player does not exist.'));
+ }
}
- elseif (!file_exists($flv_player)) {
- form_set_error('shadowbox_flv_player', t('The FLV player does not exist.'));
- }
-
+
if (!is_numeric($resize_duration) || $resize_duration < 0 || $resize_duration > 10) {
form_set_error('shadowbox_resize_duration', t('You must enter a number between 0 and 10.'));
}
@
1.38
log
@fix reverse proxy support once again
@
text
@a252 117
Properly activate Drupal support module in TinyMCE
Index: sites/all/modules/tinymce/plugin_reg.php
--- sites/all/modules/tinymce/plugin_reg.php.orig 2008-03-27 21:11:17 +0100
+++ sites/all/modules/tinymce/plugin_reg.php 2008-05-02 20:56:56 +0200
@@@@ -102,5 +102,9 @@@@
$plugins['zoom'] = array();
$plugins['zoom']['theme_advanced_buttons2'] = array('zoom');
+$plugins['drupalimage'] = array();
+$plugins['drupalimage']['theme_advanced_buttons1'] = array('drupalimage');
+$plugins['drupalimage']['extended_valid_elements'] = array('img[class|src|border=0|alt|title|width|height|align|name]');
+
return $plugins;
}
-----------------------------------------------------------------------------
Optimize "img_assist" module by loading only when necessary.
http://drupal.org/node/55101
Index: sites/all/modules/img_assist/img_assist.js
--- sites/all/modules/img_assist/img_assist.js.orig 2008-04-06 18:43:18 +0200
+++ sites/all/modules/img_assist/img_assist.js 2008-05-02 21:05:56 +0200
@@@@ -130,6 +130,24 @@@@
var win = window.open(BASE_URL + 'index.php?q=img_assist/popup/' + nid, 'imagev', 'height='+oy+'-10,width='+ox+',top='+winy+',left='+winx+',scrollbars='+use_scrollbars+',resizable');
}
+function launch_popup(nid, mw, mh) {
+ var ox = mw;
+ var oy = mh;
+ if((ox>=screen.width) || (oy>=screen.height)){
+ var ox = screen.width-150;
+ var oy = screen.height-150;
+ var winx = (screen.width / 2)-(ox / 2);
+ var winy = (screen.height / 2)-(oy / 2);
+ var use_scrollbars = 1;
+ }
+ else{
+ var winx = (screen.width / 2)-(ox / 2);
+ var winy = (screen.height / 2)-(oy / 2);
+ var use_scrollbars = 0;
+ }
+ var win = window.open(BASE_URL + 'index.php?q=img_assist/popup/' + nid, 'imagev', 'height='+oy+'-10,width='+ox+',top='+winy+',left='+winx+',scrollbars='+use_scrollbars+',resizable');
+}
+
function insertImage() {
if (window.opener) {
// Get variables from the fields on the properties frame
Index: sites/all/modules/img_assist/img_assist.module
--- sites/all/modules/img_assist/img_assist.module.orig 2008-05-02 21:04:49 +0200
+++ sites/all/modules/img_assist/img_assist.module 2008-05-02 21:07:24 +0200
@@@@ -126,7 +126,7 @@@@
}
// Assign base_path to insert in image source by javascript.
drupal_add_js('var BASE_URL = "'. base_path() .'";', 'inline');
- drupal_add_js($path .'/img_assist.js');
+ drupal_add_js($path .'/img_assist_popup.js');
}
/**
@@@@ -150,6 +150,9 @@@@
* Add image link underneath textareas.
*/
function img_assist_textarea($element) {
+ $path = drupal_get_path('module', 'img_assist');
+ drupal_add_js($path .'/img_assist.js');
+
$link = variable_get('img_assist_link', 'icon');
if (($link == 'icon') || ($link == 'text')) {
if (_img_assist_textarea_match($element['#id']) && _img_assist_page_match() && !strstr($_GET['q'], 'img_assist')) {
Index: sites/all/modules/img_assist/img_assist_popup.js
--- /dev/null 2008-05-02 21:08:21 +0200
+++ sites/all/modules/img_assist/img_assist_popup.js 2008-05-02 21:05:56 +0200
@@@@ -0,0 +1,20 @@@@
+/* $Id: drupal.patch,v 1.37 2009/05/11 20:30:19 rse Exp $ */
+
+function launch_popup(nid, mw, mh) {
+ var ox = mw;
+ var oy = mh;
+ if((ox>=screen.width) || (oy>=screen.height)){
+ var ox = screen.width-150;
+ var oy = screen.height-150;
+ var winx = (screen.width / 2)-(ox / 2);
+ var winy = (screen.height / 2)-(oy / 2);
+ var use_scrollbars = 1;
+ }
+ else{
+ var winx = (screen.width / 2)-(ox / 2);
+ var winy = (screen.height / 2)-(oy / 2);
+ var use_scrollbars = 0;
+ }
+ var win = window.open(BASE_URL + 'index.php?q=img_assist/popup/' + nid, 'imagev', 'height='+oy+'-10,width='+ox+',top='+winy+',left='+winx+',scrollbars='+use_scrollbars+',resizable');
+}
+
-----------------------------------------------------------------------------
Fix file permissions.
http://drupal.org/node/247992
Index: sites/all/modules/img_assist/img_assist.module
--- sites/all/modules/img_assist/img_assist.module.orig 2008-05-02 21:11:15 +0200
+++ sites/all/modules/img_assist/img_assist.module 2008-05-02 21:11:48 +0200
@@@@ -1230,6 +1230,8 @@@@
drupal_set_message(t('Unable to create %label image', array('%label' => $size['label'])), 'error');
}
else {
+ // Set standard file permissions for webserver-generated files
+ @@chmod(file_create_path($destination), 0664);
$node->images[$key] = $destination;
_image_insert($node, $key, file_create_path($destination));
}
-----------------------------------------------------------------------------
@
1.37
log
@add shadowbox patch
@
text
@d39 8
d329 1
a329 1
+/* $Id: drupal.patch,v 1.36 2009/04/19 08:14:49 rse Exp $ */
@
1.36
log
@modifying package: drupal-6.10 20090416 -> 20090419
@
text
@d321 1
a321 1
+/* $Id: drupal.patch,v 1.35 2008/12/11 07:10:07 rse Exp $ */
d766 38
@
1.35
log
@upgrading package: drupal 6.6 -> 6.7
@
text
@d321 1
a321 1
+/* $Id: drupal.patch,v 1.34 2008/10/17 18:20:51 rse Exp $ */
a610 15
Index: sites/all/modules/autologout/autologout.module
--- sites/all/modules/autologout/autologout.module.orig 2008-03-14 21:05:41 +0100
+++ sites/all/modules/autologout/autologout.module 2008-06-14 15:57:27 +0200
@@@@ -257,8 +257,8 @@@@
if (_autologout_user_in_by_user_role($account)) {
$account->autologout = 0;
$r = db_query("SELECT setting FROM {autologout} WHERE uid = %d", $account->uid);
- if (db_num_rows($r) > 0) {
- $row = db_fetch_object($r);
+ $row = db_fetch_object($r);
+ if ($row) {
$account->autologout = (int)$row->setting;
}
}
@
1.34
log
@modifying package: drupal-6.5 20081017 again
@
text
@a145 9
@@@@ -1805,7 +1832,7 @@@@
$last = '';
while ($path != $last) {
$last = $path;
- $path = preg_replace('`(^|/)(?!../)([^/]+)/../`', '$1', $path);
+ $path = preg_replace('`(^|/)(?!\.\./)([^/]+)/\.\./`', '$1', $path);
}
return 'url('. $path .')';
}
d321 1
a321 1
+/* $Id: drupal.patch,v 1.33 2008/10/15 18:04:40 rse Exp $ */
@
1.33
log
@modifying package: drupal-6.5 20081015 again
@
text
@d330 1
a330 1
+/* $Id: drupal.patch,v 1.32 2008/10/11 07:18:03 rse Exp $ */
a598 17
@@@@ -40,13 +40,15 @@@@
// Fetch up to N feed items and update their iids to new schema
$count = $_SESSION['simplefeed_item_update_2']['count'];
$feed_items = db_query_range('SELECT r.vid, r.title, s.url FROM {node_revisions} r JOIN {simplefeed_feed_item} s ON r.vid = s.vid ORDER BY r.vid ASC', $count, $limit);
+ $n = 0;
while ($feed_item = db_fetch_object($feed_items)) {
$iid = md5($feed_item->title . $feed_item->url);
db_query("UPDATE {simplefeed_feed_item} SET iid = '%s' WHERE vid = %d", $iid, $feed_item->vid);
$_SESSION['simplefeed_item_update_2']['vid'] = $feed_item->vid;
+ $n++;
}
- if (db_num_rows($feed_items) == $limit) {
+ if ($n == $limit) {
$_SESSION['simplefeed_item_update_2']['count'] += $limit;
// Return progress (never return 100% here to ensure clean-up is still run last).
return array('#finished' => $_SESSION['simplefeed_item_update_2']['vid'] / ($_SESSION['simplefeed_item_update_2']['max'] + 1));
@
1.32
log
@upgrading package: drupal 6.4 -> 6.5
@
text
@a269 17
-----------------------------------------------------------------------------
Fix SQL in "remove" functionality of "img_assist" module.
http://drupal.org/node/250128
Index: sites/all/modules/img_assist/img_assist.module
--- sites/all/modules/img_assist/img_assist.module.orig 2008-04-06 19:32:33 +0200
+++ sites/all/modules/img_assist/img_assist.module 2008-05-02 21:00:24 +0200
@@@@ -1239,7 +1239,7 @@@@
}
function _img_assist_remove($node, $size) {
- $result = db_query("SELECT * FROM {files} f INNER JOIN {image} i WHERE f.fid = i.fid AND i.nid = %d AND f.filename = '%s'", $node->nid, $size['key']);
+ $result = db_query("SELECT * FROM {files} f INNER JOIN {image} ON f.fid = i.fid WHERE i.nid = %d AND f.filename = '%s'", $node->nid, $size['key']);
while ($file = db_fetch_object($result)) {
// Never delete original image.
if ($file->filepath != $node->images[IMAGE_ORIGINAL]) {
d330 1
a330 1
+/* $Id: drupal.patch,v 1.31 2008/09/01 08:56:39 rse Exp $ */
@
1.31
log
@fix quoting
@
text
@d347 1
a347 1
+/* $Id: drupal.patch,v 1.30 2008/08/25 15:27:38 rse Exp $ */
a405 21
Degrade the "Update notification" check from ERROR to WARNING severity
as for a packaged Drupal as in OpenPKG the Update notification is less
important and actually confusing anyway. With WARNING one at least still
sees the issue, but under "Administer" one doesn't get the confusing red
error message and longer.
Index: modules/system/system.install
--- modules/system/system.install.orig 2008-02-08 18:07:55 +0100
+++ modules/system/system.install 2008-05-03 10:42:23 +0200
@@@@ -273,7 +273,7 @@@@
if (!module_exists('update')) {
$requirements['update status'] = array(
'value' => $t('Not enabled'),
- 'severity' => REQUIREMENT_ERROR,
+ 'severity' => REQUIREMENT_WARNING,
'description' => $t('Update notifications are not enabled. It is highly recommended that you enable the update status module from the module administration page in order to stay up-to-date on new releases. For more information please read the Update status handbook page.', array('@@update' => 'http://drupal.org/handbook/modules/update', '@@module' => url('admin/build/modules'))),
);
}
-----------------------------------------------------------------------------
a823 112
-----------------------------------------------------------------------------
Fix "Action" related administration dialog and corresponding run-time handling.
Index: modules/system/system.module
--- modules/system/system.module.orig 2008-04-09 23:11:49 +0200
+++ modules/system/system.module 2008-05-23 10:41:26 +0200
@@@@ -1431,7 +1439,7 @@@@
if (is_numeric($action)) {
$aid = $action;
// Load stored parameter values from database.
- $data = db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid = %d", intval($aid)));
+ $data = db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid = '%s'", $aid));
$edit['actions_description'] = $data->description;
$edit['actions_type'] = $data->type;
$function = $data->callback;
Index: includes/actions.inc
--- includes/actions.inc.orig 2007-12-31 15:51:04 +0100
+++ includes/actions.inc 2008-05-23 11:22:17 +0200
@@@@ -54,7 +54,7 @@@@
$where_values = array();
foreach ($action_ids as $action_id) {
if (is_numeric($action_id)) {
- $where[] = 'OR aid = %d';
+ $where[] = "OR aid = '%s'";
$where_values[] = $action_id;
}
elseif (isset($available_actions[$action_id])) {
@@@@ -93,7 +93,7 @@@@
else {
// If it's a configurable action, retrieve stored parameters.
if (is_numeric($action_ids)) {
- $action = db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid = %d", $action_ids));
+ $action = db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid = '%s'", $action_ids));
$function = $action->callback;
$context = array_merge($context, unserialize($action->parameters));
$result[$action_ids] = $function($object, $context, $a1, $a2);
@@@@ -325,7 +325,7 @@@@
function actions_save($function, $type, $params, $desc, $aid = NULL) {
$serialized = serialize($params);
if ($aid) {
- db_query("UPDATE {actions} SET callback = '%s', type = '%s', parameters = '%s', description = '%s' WHERE aid = %d", $function, $type, $serialized, $desc, $aid);
+ db_query("UPDATE {actions} SET callback = '%s', type = '%s', parameters = '%s', description = '%s' WHERE aid = '%s'", $function, $type, $serialized, $desc, $aid);
watchdog('actions', 'Action %action saved.', array('%action' => $desc));
}
else {
@@@@ -333,7 +333,7 @@@@
// separate table for numeric aids.
db_query('INSERT INTO {actions_aid} VALUES (default)');
$aid = db_last_insert_id('actions_aid', 'aid');
- db_query("INSERT INTO {actions} (aid, callback, type, parameters, description) VALUES (%d, '%s', '%s', '%s', '%s')", $aid, $function, $type, $serialized, $desc);
+ db_query("INSERT INTO {actions} (aid, callback, type, parameters, description) VALUES ('%s', '%s', '%s', '%s', '%s')", $aid, $function, $type, $serialized, $desc);
watchdog('actions', 'Action %action created.', array('%action' => $desc));
}
@@@@ -350,7 +350,7 @@@@
* The appropriate action row from the database as an object.
*/
function actions_load($aid) {
- return db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid = %d", $aid));
+ return db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid = '%s'", $aid));
}
/**
@@@@ -360,6 +360,6 @@@@
* integer The ID of the action to delete.
*/
function actions_delete($aid) {
- db_query("DELETE FROM {actions} WHERE aid = %d", $aid);
+ db_query("DELETE FROM {actions} WHERE aid = '%s'", $aid);
module_invoke_all('actions_delete', $aid);
}
Index: modules/user/user.admin.inc
--- modules/user/user.admin.inc.orig 2008-08-14 01:59:14 +0200
+++ modules/user/user.admin.inc 2008-08-25 17:24:27 +0200
@@@@ -721,7 +721,7 @@@@
* Menu callback: edit an access rule.
*/
function user_admin_access_edit($aid = 0) {
- $edit = db_fetch_array(db_query('SELECT aid, type, status, mask FROM {access} WHERE aid = %d', $aid));
+ $edit = db_fetch_array(db_query("SELECT aid, type, status, mask FROM {access} WHERE aid = '%s'", $aid));
return drupal_get_form('user_admin_access_edit_form', $edit, t('Save rule'));
}
@@@@ -770,7 +770,7 @@@@
function user_admin_access_form_submit($form, &$form_state) {
$edit = $form_state['values'];
if ($edit['aid']) {
- db_query("UPDATE {access} SET mask = '%s', type = '%s', status = '%s' WHERE aid = %d", $edit['mask'], $edit['type'], $edit['status'], $edit['aid']);
+ db_query("UPDATE {access} SET mask = '%s', type = '%s', status = '%s' WHERE aid = '%s'", $edit['mask'], $edit['type'], $edit['status'], $edit['aid']);
drupal_set_message(t('The access rule has been saved.'));
}
else {
@@@@ -858,7 +858,7 @@@@
*/
function user_admin_access_delete_confirm($form_state, $aid = 0) {
$access_types = array('user' => t('username'), 'mail' => t('e-mail'), 'host' => t('host'));
- $edit = db_fetch_object(db_query('SELECT aid, type, status, mask FROM {access} WHERE aid = %d', $aid));
+ $edit = db_fetch_object(db_query("SELECT aid, type, status, mask FROM {access} WHERE aid = '%s'", $aid));
$form = array();
$form['aid'] = array('#type' => 'hidden', '#value' => $aid);
@@@@ -872,7 +872,7 @@@@
}
function user_admin_access_delete_confirm_submit($form, &$form_state) {
- db_query('DELETE FROM {access} WHERE aid = %d', $form_state['values']['aid']);
+ db_query("DELETE FROM {access} WHERE aid = '%s'", $form_state['values']['aid']);
drupal_set_message(t('The access rule has been deleted.'));
$form_state['redirect'] = 'admin/user/rules';
return;
@
1.30
log
@Fix again the 'actions' related administration dialog and corresponding run-time handling
@
text
@d347 1
a347 1
+/* $Id: drupal.patch,v 1.29 2008/08/16 18:26:08 rse Exp $ */
d926 1
a926 1
+ $edit = db_fetch_array(db_query('SELECT aid, type, status, mask FROM {access} WHERE aid = '%s'', $aid));
@
1.29
log
@upgrading package: drupal 6.3 -> 6.4
@
text
@d347 1
a347 1
+/* $Id: drupal.patch,v 1.28 2008/07/29 19:23:45 rse Exp $ */
d845 112
@
1.28
log
@reduce BLOG block to just 5 items
@
text
@d347 1
a347 1
+/* $Id: drupal.patch,v 1.27 2008/06/26 18:27:23 rse Exp $ */
a477 111
Fix "Action" related administration dialog and corresponding run-time handling.
Index: modules/system/system.module
--- modules/system/system.module.orig 2008-04-09 23:11:49 +0200
+++ modules/system/system.module 2008-05-23 10:41:26 +0200
@@@@ -1431,7 +1439,7 @@@@
if (is_numeric($action)) {
$aid = $action;
// Load stored parameter values from database.
- $data = db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid = %d", intval($aid)));
+ $data = db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid = '%s'", $aid));
$edit['actions_description'] = $data->description;
$edit['actions_type'] = $data->type;
$function = $data->callback;
Index: includes/actions.inc
--- includes/actions.inc.orig 2007-12-31 15:51:04 +0100
+++ includes/actions.inc 2008-05-23 11:22:17 +0200
@@@@ -54,7 +54,7 @@@@
$where_values = array();
foreach ($action_ids as $action_id) {
if (is_numeric($action_id)) {
- $where[] = 'OR aid = %d';
+ $where[] = "OR aid = '%s'";
$where_values[] = $action_id;
}
elseif (isset($available_actions[$action_id])) {
@@@@ -93,7 +93,7 @@@@
else {
// If it's a configurable action, retrieve stored parameters.
if (is_numeric($action_ids)) {
- $action = db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid = %d", $action_ids));
+ $action = db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid = '%s'", $action_ids));
$function = $action->callback;
$context = array_merge($context, unserialize($action->parameters));
$result[$action_ids] = $function($object, $context, $a1, $a2);
@@@@ -325,7 +325,7 @@@@
function actions_save($function, $type, $params, $desc, $aid = NULL) {
$serialized = serialize($params);
if ($aid) {
- db_query("UPDATE {actions} SET callback = '%s', type = '%s', parameters = '%s', description = '%s' WHERE aid = %d", $function, $type, $serialized, $desc, $aid);
+ db_query("UPDATE {actions} SET callback = '%s', type = '%s', parameters = '%s', description = '%s' WHERE aid = '%s'", $function, $type, $serialized, $desc, $aid);
watchdog('actions', 'Action %action saved.', array('%action' => $desc));
}
else {
@@@@ -333,7 +333,7 @@@@
// separate table for numeric aids.
db_query('INSERT INTO {actions_aid} VALUES (default)');
$aid = db_last_insert_id('actions_aid', 'aid');
- db_query("INSERT INTO {actions} (aid, callback, type, parameters, description) VALUES (%d, '%s', '%s', '%s', '%s')", $aid, $function, $type, $serialized, $desc);
+ db_query("INSERT INTO {actions} (aid, callback, type, parameters, description) VALUES ('%s', '%s', '%s', '%s', '%s')", $aid, $function, $type, $serialized, $desc);
watchdog('actions', 'Action %action created.', array('%action' => $desc));
}
@@@@ -350,7 +350,7 @@@@
* The appropriate action row from the database as an object.
*/
function actions_load($aid) {
- return db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid = %d", $aid));
+ return db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid = '%s'", $aid));
}
/**
@@@@ -360,6 +360,6 @@@@
* integer The ID of the action to delete.
*/
function actions_delete($aid) {
- db_query("DELETE FROM {actions} WHERE aid = %d", $aid);
+ db_query("DELETE FROM {actions} WHERE aid = '%s'", $aid);
module_invoke_all('actions_delete', $aid);
}
Index: modules/user/user.admin.inc
--- modules/user/user.admin.inc.orig 2008-01-16 23:54:41 +0100
+++ modules/user/user.admin.inc 2008-05-23 11:24:13 +0200
@@@@ -737,13 +737,13 @@@@
form_set_error('mask', t('You must enter a mask.'));
}
else {
- db_query("UPDATE {access} SET mask = '%s', type = '%s', status = '%s' WHERE aid = %d", $edit['mask'], $edit['type'], $edit['status'], $aid);
+ db_query("UPDATE {access} SET mask = '%s', type = '%s', status = '%s' WHERE aid = '%s'", $edit['mask'], $edit['type'], $edit['status'], $aid);
drupal_set_message(t('The access rule has been saved.'));
drupal_goto('admin/user/rules');
}
}
else {
- $edit = db_fetch_array(db_query('SELECT aid, type, status, mask FROM {access} WHERE aid = %d', $aid));
+ $edit = db_fetch_array(db_query("SELECT aid, type, status, mask FROM {access} WHERE aid = '%s'", $aid));
}
return drupal_get_form('user_admin_access_edit_form', $edit, t('Save rule'));
}
@@@@ -859,7 +859,7 @@@@
*/
function user_admin_access_delete_confirm($form_state, $aid = 0) {
$access_types = array('user' => t('username'), 'mail' => t('e-mail'), 'host' => t('host'));
- $edit = db_fetch_object(db_query('SELECT aid, type, status, mask FROM {access} WHERE aid = %d', $aid));
+ $edit = db_fetch_object(db_query("SELECT aid, type, status, mask FROM {access} WHERE aid = '%s'", $aid));
$form = array();
$form['aid'] = array('#type' => 'hidden', '#value' => $aid);
@@@@ -873,7 +873,7 @@@@
}
function user_admin_access_delete_confirm_submit($form, &$form_state) {
- db_query('DELETE FROM {access} WHERE aid = %d', $form_state['values']['aid']);
+ db_query("DELETE FROM {access} WHERE aid = '%s'", $form_state['values']['aid']);
drupal_set_message(t('The access rule has been deleted.'));
$form_state['redirect'] = 'admin/user/rules';
return;
-----------------------------------------------------------------------------
@
1.27
log
@fix CSS cache building procedure by applying the missing and required character escaping
@
text
@d347 1
a347 1
+/* $Id: drupal.patch,v 1.26 2008/06/26 15:52:26 rse Exp $ */
d890 3
a892 3
--- modules/blog/blog.module.orig 2008-04-09 23:11:45 +0200
+++ modules/blog/blog.module 2008-06-26 17:20:15 +0200
@@@@ -182,7 +182,7 @@@@
d901 7
d913 1
a913 1
+ $result = db_query_range("SELECT n.nid, n.title, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC", 0, 10);
@
1.26
log
@fix BLOG ordering
@
text
@d70 1
a70 1
Support HTTP Proxies (mainly for update checks, RSS fetching, etc)
d75 5
d82 1
a82 1
+++ includes/common.inc 2008-04-24 11:41:40 +0200
d146 9
d347 1
a347 1
+/* $Id: drupal.patch,v 1.25 2008/06/18 16:03:06 rse Exp $ */
@
1.25
log
@fix another module which is broken under PostgreSQL because the author just did a blind syntax guess
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.24 2008/06/16 16:11:13 rse Exp $ */
d869 66
@
1.24
log
@fix helpers module for PostgreSQL usage
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.23 2008/06/14 14:26:34 rse Exp $ */
d847 22
@
1.23
log
@Ok, the 'simplefeed' author seems to be a MySQL-only developer, so we have to patch even more
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.22 2008/06/14 14:01:05 rse Exp $ */
d787 60
@
1.22
log
@Fix modules as Drupal 6.2 does not provide db_num_rows() anymore.
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.21 2008/06/14 13:14:46 rse Exp $ */
d706 1
a730 4
-----------------------------------------------------------------------------
Fix modules as Drupal 6.2 does not provide db_num_rows() anymore.
d733 1
a733 1
+++ sites/all/modules/simplefeed/simplefeed_item.install 2008-06-14 15:49:19 +0200
d751 21
@
1.21
log
@fix 'simplefeed' module update under PostgreSQL
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.20 2008/05/30 19:18:50 rse Exp $ */
d730 39
@
1.20
log
@try to add support relative paths in the template file by switching the directory temporarily
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.19 2008/05/29 11:13:43 rse Exp $ */
d703 27
@
1.19
log
@substitute XML entities also in the XML stylesheet
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.18 2008/05/29 10:12:36 rse Exp $ */
d586 2
a587 2
+++ sites/all/modules/xmlcontent/xmlcontent.module 2008-05-29 13:11:51 +0200
@@@@ -39,7 +39,16 @@@@
d592 1
d599 2
d605 4
a608 1
return _xmlcontent_transform($text, $xslt_path);
d611 2
a612 1
@@@@ -72,7 +81,7 @@@@
d621 1
a621 1
@@@@ -83,7 +92,10 @@@@
d633 1
a633 1
@@@@ -93,7 +105,16 @@@@
d645 2
d649 6
a654 1
+ if (!_xmlcontent_validate($text, $validation, $schema_path)) {
d658 1
a658 1
@@@@ -156,6 +177,13 @@@@
d672 1
a672 1
@@@@ -218,6 +246,8 @@@@
d681 1
a681 1
@@@@ -227,6 +257,8 @@@@
d690 1
a690 1
@@@@ -242,10 +274,8 @@@@
@
1.18
log
@fix template handling
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.17 2008/05/29 06:29:42 rse Exp $ */
d586 1
a586 1
+++ sites/all/modules/xmlcontent/xmlcontent.module 2008-05-29 12:10:00 +0200
d667 10
a676 1
@@@@ -242,10 +272,8 @@@@
@
1.17
log
@modifying package: drupal-6.2 20080528 -> 20080529
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.16 2008/05/28 18:59:11 rse Exp $ */
d586 1
a586 1
+++ sites/all/modules/xmlcontent/xmlcontent.module 2008-05-29 08:27:28 +0200
d593 1
a593 1
+ if ($tpl_path != "") {
d597 1
a597 1
+ $text = preg_replace(/&template_body;/, $text, $tpl);
d626 19
a644 1
@@@@ -156,6 +168,13 @@@@
d658 1
a658 1
@@@@ -218,6 +237,8 @@@@
d667 1
a667 1
@@@@ -242,10 +263,8 @@@@
@
1.16
log
@support prepending an XML prolog: mainly for ENTITY declarations
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.15 2008/05/23 18:26:23 rse Exp $ */
d581 1
a581 1
4. Additionally, support an optional XML content prolog (mainly
d586 1
a586 1
+++ sites/all/modules/xmlcontent/xmlcontent.module 2008-05-28 20:55:11 +0200
d592 6
a597 6
+ $prolog_path = variable_get("xmlcontent_prolog_path_$format", '');
+ if ($prolog_path != "") {
+ if (substr($prolog_path, 0, 1) != "/")
+ $prolog_path = drupal_get_path('module', 'xmlcontent') . '/' . $prolog_path;
+ $prolog = file_get_contents($prolog_path);
+ $text = $prolog . $text;
d630 1
a630 1
+ $form['xmlcontent']["xmlcontent_prolog_path_$format"] = array(
d632 2
a633 2
+ '#title' => t('Optional XML Prolog File Path'),
+ '#default_value' => variable_get("xmlcontent_prolog_path_$format", ''),
d635 1
a635 1
+ '#description' => t('The file path to the optional XML prolog, prepended to the XML content before processing.'),
d640 10
a649 1
@@@@ -242,10 +261,8 @@@@
@
1.15
log
@get rid of the declaration in the snippet output
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.14 2008/05/23 16:58:41 rse Exp $ */
d581 2
d586 2
a587 2
+++ sites/all/modules/xmlcontent/xmlcontent.module 2008-05-23 20:23:31 +0200
@@@@ -39,7 +39,9 @@@@
d592 7
d605 1
a605 1
@@@@ -72,7 +74,7 @@@@
d614 1
a614 1
@@@@ -83,7 +85,10 @@@@
d626 15
a640 1
@@@@ -242,10 +247,8 @@@@
@
1.14
log
@allow .xsd/.xsl files under arbitrary paths
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.13 2008/05/23 16:28:33 rse Exp $ */
d575 6
a580 2
Fix content validation in "xmlcontent" module in case
one has enabled multiple filters on a particular input format.
a581 3
Additionally, allow absolute paths to support .xsd/.xsl files
in arbitrary directories.
d584 1
a584 1
+++ sites/all/modules/xmlcontent/xmlcontent.module 2008-05-23 18:56:10 +0200
d617 13
@
1.13
log
@Arglll... is it me, is it really me? Every piece of code I want to _USE_ I first have to _FIX_. This time the developer of the 'xmlcontent' module has never tested its module in case one has multiple filters enabled for a particular input type
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.12 2008/05/23 15:11:55 rse Exp $ */
d577 3
d583 13
a595 2
+++ sites/all/modules/xmlcontent/xmlcontent.module 2008-05-23 18:22:29 +0200
@@@@ -72,7 +72,7 @@@@
d604 12
a615 1
@
1.12
log
@fix quotes
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.11 2008/05/23 09:27:18 rse Exp $ */
d572 19
@
1.11
log
@hmmm.... Drupal uses the 'aid' field of the 'actions' table incorrectly at a lot more code locations. Fix all of them, too
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.10 2008/05/23 08:44:10 rse Exp $ */
d550 1
a550 1
+ $edit = db_fetch_array(db_query('SELECT aid, type, status, mask FROM {access} WHERE aid = '%s'', $aid));
@
1.10
log
@Fix Action administration dialog
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.9 2008/05/16 18:12:17 rse Exp $ */
d464 1
a464 1
Fix "Action" administration dialog.
d479 93
@
1.9
log
@modifying package: drupal-6.2 20080516 again
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.8 2008/05/09 12:12:24 rse Exp $ */
d462 17
@
1.8
log
@try to disable update notifications during install
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.7 2008/05/03 08:46:37 rse Exp $ */
d428 34
@
1.7
log
@remove annoying Update notification stuff
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.6 2008/05/02 21:16:00 rse Exp $ */
d411 17
@
1.6
log
@FCKeditor integration improvements
@
text
@d333 1
a333 1
+/* $Id: drupal.patch,v 1.5 2008/05/02 19:17:58 rse Exp $ */
d390 21
@
1.5
log
@apply two additional patches for img_assist and downgrade TinyMCE to version 2.1 as the img_assist support for TinyMCE is not compatible with TinyMCE 3.0
@
text
@d333 1
a333 1
+/* $Id: img_assist_popup.js,v 1.4.2.2 2007/04/09 22:57:22 darrenoh Exp $ */
d371 19
@
1.4
log
@move patch to drupal.patch as we have to patch even more (one thing is img_assist module now)
@
text
@d274 97
@
1.3
log
@Support HTTP Proxies
@
text
@d237 37
@
1.2
log
@apply a patch for allowing one to drive a Drupal behind a reverse proxy without breaking forms
@
text
@d1 4
d67 170
@
1.1
log
@upgrading package: drupal 4.7.6 -> 5.1
@
text
@d1 8
a8 9
Index: modules/system/system.install
--- modules/system/system.install.orig 2007-01-11 00:22:34 +0100
+++ modules/system/system.install 2007-07-05 18:35:56 +0200
@@@@ -1108,6 +1108,7 @@@@
db_query("INSERT INTO {menu} (mid, pid, path, title, description, weight, type) VALUES (2, 0, '', 'Primary links', '', 0, 115)");
db_query("INSERT INTO {variable} VALUES ('menu_primary_menu', 'i:2;')");
db_query("INSERT INTO {variable} VALUES ('menu_secondary_menu', 'i:2;')");
+ db_query("INSERT INTO {variable} VALUES ('site_footer', 's:56:\"powered by OpenPKG\";')");
}
d10 53
a62 2
// Updates for core
@