drupal.patch 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. Index: includes/bootstrap.inc
  2. --- includes/bootstrap.inc.orig 2008-02-11 15:36:21 +0100
  3. +++ includes/bootstrap.inc 2008-04-09 20:47:49 +0200
  4. @@ -272,6 +272,7 @@
  5. */
  6. function conf_init() {
  7. global $base_url, $base_path, $base_root;
  8. + global $base_url_local;
  9. // Export the following settings.php variables to the global namespace
  10. global $db_url, $db_prefix, $cookie_domain, $conf, $installed_profile, $update_free_access;
  11. @@ -723,9 +724,22 @@
  12. * generate an equivalent using other environment variables.
  13. */
  14. function request_uri() {
  15. + global $base_url;
  16. + global $base_url_local;
  17. if (isset($_SERVER['REQUEST_URI'])) {
  18. $uri = $_SERVER['REQUEST_URI'];
  19. + if (isset($base_url) && isset($base_url_local)) {
  20. + $parts = parse_url($base_url_local);
  21. + if ( strlen($uri) >= strlen($base_url_local)
  22. + && substr($uri, 0, strlen($base_url_local)) == $base_url_local) {
  23. + $uri = $base_url . substr($uri, strlen($base_url_local));
  24. + }
  25. + elseif ( strlen($uri) >= strlen($parts["path"])
  26. + && substr($uri, 0, strlen($parts["path"])) == $parts["path"]) {
  27. + $uri = $base_url . substr($uri, strlen($parts["path"]));
  28. + }
  29. + }
  30. }
  31. else {
  32. if (isset($_SERVER['argv'])) {
  33. Index: sites/default/default.settings.php
  34. --- sites/default/default.settings.php.orig 2007-12-20 10:35:10 +0100
  35. +++ sites/default/default.settings.php 2008-04-09 20:47:32 +0200
  36. @@ -126,6 +126,24 @@
  37. # $base_url = 'http://www.example.com'; // NO trailing slash!
  38. /**
  39. + * Local Base URL (optional).
  40. + *
  41. + * If you are running Drupal behind a reverse proxy, $base_url (see above)
  42. + * usually points to the URL of the reverse proxy. Drupal uses this for
  43. + * all sorts of external URLs. In order to correctly calculate sub-URLs
  44. + * below $base_url for embedded HTML forms, Drupal also has to know the
  45. + * URL on the local/origin server under which Drupal is contacted by the
  46. + * reverse proxy. This is what $base_url_local is for.
  47. + *
  48. + * Examples:
  49. + * $base_url_local = 'http://www.example.com:8080/drupal';
  50. + *
  51. + * It is not allowed to have a trailing slash; Drupal will add it
  52. + * for you.
  53. + */
  54. +# $base_url_local = 'http://www.example.com:8080/drupal'; // NO trailing slash!
  55. +
  56. +/**
  57. * PHP settings:
  58. *
  59. * To see what PHP settings are possible, including whether they can