Advertisement
Guest User

realurl-extbase-empty-param-hack.diff

a guest
Jun 16th, 2011
554
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. Index: class.tx_realurl.php
  2. ===================================================================
  3. --- class.tx_realurl.php (revision 63)
  4. +++ class.tx_realurl.php (revision 64)
  5. @@ -828,10 +828,12 @@
  6. // the same speaking URL in the cache table!)
  7. if (isset($paramKeyValues['cHash'])) {
  8.  
  9. + //rebuild will be triggered for empty values
  10. if ($this->rebuildCHash) {
  11. $cHashParameters = array_merge($this->cHashParameters, $paramKeyValues);
  12. unset($cHashParameters['cHash']);
  13. - $cHashParameters = t3lib_div::cHashParams(t3lib_div::implodeArrayForUrl('', $cHashParameters));
  14. + //we will not accept empty values for cHash generation since we do not add them on rebuilding query string
  15. + $cHashParameters = t3lib_div::cHashParams(t3lib_div::implodeArrayForUrl('', $cHashParameters, '', true));
  16. if (method_exists('t3lib_div', 'calculateCHash')) {
  17. $paramKeyValues['cHash'] = t3lib_div::calculateCHash($cHashParameters);
  18. }
  19. @@ -1471,7 +1473,9 @@
  20. // we stripped empty segments at the end of the URL on encoding.
  21. // Reconstruct them or cHash check will fail in TSFE.
  22. // Related to bug #15906.
  23. - $GET_string .= '&' . rawurlencode($setup['GETvar']) . '=';
  24. +
  25. + // per definition we will not accept empty values within decode
  26. + // $GET_string .= '&' . rawurlencode($setup['GETvar']) . '=';
  27. }
  28. else {
  29. // Get value and remove from path parts:
  30. @@ -1551,7 +1555,10 @@
  31. if (isset($this->extConf['init']['emptySegmentValue']) && $this->extConf['init']['emptySegmentValue'] === $value) {
  32. $value = '';
  33. }
  34. - $GET_string .= '&' . rawurlencode($setup['GETvar']) . '=' . rawurlencode($value);
  35. + // per definition we will not accept empty values within decode
  36. + if (strlen($value) > 0) {
  37. + $GET_string .= '&' . rawurlencode($setup['GETvar']) . '=' . rawurlencode($value);
  38. + }
  39. }
  40. } else {
  41. array_unshift($pathParts, $origValue);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement