Permalink
Browse files

Merge branch 'release-2.2' into develop

* release-2.2:
  Preserve GET parameters for container_suffix redirects
  Allow custom FURLs via URL rewriting again
  [#7427] Fix request_method_strict with FURLs off
  Bump version for 2.2.2-pl release

Conflicts:
	core/docs/changelog.txt
  • Loading branch information...
2 parents 4040a48 + 42a3b5a commit 4877a7aeecba5e74e065572d4d1e45c455c8acb3 @opengeek opengeek committed May 1, 2012
Showing with 24 additions and 11 deletions.
  1. +2 −2 _build/build.sample.properties
  2. +1 −1 _build/build.xml
  3. +5 −0 core/docs/changelog.txt
  4. +16 −8 core/model/modx/modrequest.class.php
@@ -11,7 +11,7 @@ git.command = git
#project.name.fs = modx
# Override to set the version and release strings
-#modx.core.version = 2.2.1
+#modx.core.version = 2.2.2
#modx.core.release = pl
# these properties require a local Git clone in order to produce distributions
@@ -25,7 +25,7 @@ git.command = git
#build.nominify = true
# Override to pull source from a specific ref in the git repository
-#build.src.tree = v2.2.1-pl
+#build.src.tree = v2.2.2-pl
# Override to turn off the additional of timestamps to the distribution packages (used for nightlies)
#build.timestamp = false
View
@@ -19,7 +19,7 @@
<property name="project.manager.dir" value="${project.root.dir}/manager" />
<!-- Set the project version -->
- <property name="modx.core.version" value="2.2.1" />
+ <property name="modx.core.version" value="2.2.2" />
<property name="modx.core.release" value="pl" />
<!-- Set some common build properties -->
View
@@ -5,6 +5,11 @@ development release, and is only shown to give an idea of what's currently in th
- Allow Namespace-based loading of custom TV files
- Deprecate usage of modAction objects in favor of modNamespace base controller path
+MODX Revolution 2.2.2-pl (May 1, 2012)
+====================================
+- Preserve GET parameters for container_suffix redirects
+- Allow custom FURLs via URL rewriting again
+- [#7427] Fix request_method_strict with FURLs off
- Add ability to extend manager session by relogging in without leaving manager screen
- Add better handling for AJAX exceptions, displaying AJAX errors
- [#7649] Prevent E_NOTICE when using ago filter within <1sec difference
@@ -151,12 +151,14 @@ public function prepareResponse(array $options = array()) {
*/
public function getResourceMethod() {
$method = '';
- if ($this->modx->getOption('request_method_strict', null, false)) {
- $method = $this->modx->getOption('friendly_urls', null, false) ? 'alias' : 'id';
- } else {
- if (isset ($_REQUEST[$this->modx->getOption('request_param_alias',null,'q')])) {
+ $hasId = isset($_REQUEST[$this->modx->getOption('request_param_id',null,'id')]);
+ $hasAlias = isset($_REQUEST[$this->modx->getOption('request_param_alias',null,'q')]);
+ if ($hasId || $hasAlias) {
+ if ($this->modx->getOption('request_method_strict', null, false)) {
+ $method = $this->modx->getOption('friendly_urls', null, false) ? 'alias' : 'id';
+ } elseif ($hasAlias) {
$method = "alias";
- } elseif (isset ($_REQUEST[$this->modx->getOption('request_param_id',null,'id')])) {
+ } elseif ($hasId) {
$method = "id";
}
}
@@ -328,7 +330,9 @@ public function _cleanResourceIdentifier($identifier) {
$identifier = "{$identifier}{$containerSuffix}";
}
if (isset ($this->modx->aliasMap[$identifier])) {
- $url = $this->modx->makeUrl($this->modx->aliasMap[$identifier], '', '', 'full');
+ $parameters = $this->getParameters();
+ unset($parameters[$this->modx->getOption('request_param_alias')]);
+ $url = $this->modx->makeUrl($this->modx->aliasMap[$identifier], '', $parameters, 'full');
$this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));
}
$this->modx->resourceMethod = 'alias';
@@ -337,8 +341,12 @@ public function _cleanResourceIdentifier($identifier) {
elseif ($this->modx->getOption('site_start', null, 1) == $this->modx->aliasMap[$identifier]) {
$this->modx->sendRedirect($this->modx->getOption('site_url', null, MODX_SITE_URL), array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));
} else {
- $requestUri = preg_replace('/\?.*/', '', $_SERVER['REQUEST_URI']);
- if ($this->modx->getOption('base_url', null, MODX_BASE_URL) . $identifier !== urldecode ($requestUri)) {
+ $requestUri = $_SERVER['REQUEST_URI'];
+ $qsPos = strpos($requestUri, '?');
+ if ($qsPos !== false) $requestUri = substr($requestUri, 0, $qsPos);
+ $fullId = $this->modx->getOption('base_url', null, MODX_BASE_URL) . $identifier;
+ $requestUri = urldecode($requestUri);
+ if ($fullId !== $requestUri && strpos($requestUri, $fullId) !== 0) {
$parameters = $this->getParameters();
unset($parameters[$this->modx->getOption('request_param_alias')]);
$url = $this->modx->makeUrl($this->modx->aliasMap[$identifier], '', $parameters, 'full');

0 comments on commit 4877a7a

Please sign in to comment.