Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix wrong modname with shorturls, closes #362. #377

Merged
1 commit merged into from

1 participant

@phaidon
Owner

No description provided.

@ghost

Does the installer still work with this patch applied?
If not, I am tempted to just remove this static caching as it's pretty useless code - it's not really saving anything.

@ghost

I tested and this patch does not upset the installer so it's OK for merge.

@ghost ghost merged commit 6d17c2a into zikula:release-1.3
@paustian paustian referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 28, 2012
  1. Fix wrong modname with shorturls, closes #362.

    Phaidon authored
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/lib/util/ModUtil.php
View
13 src/lib/util/ModUtil.php
@@ -1458,7 +1458,18 @@ public static function getName()
self::$cache['modgetname'] = FormUtil::getPassedValue('module', null, 'GETPOST', FILTER_SANITIZE_STRING);
if (empty(self::$cache['modgetname'])) {
- self::$cache['modgetname'] = System::getVar('startpage');
+ if (!System::getVar('startpage')) {
+ self::$cache['modgetname'] = System::getVar('startpage');
+ } else {
+ $baseUriLenght = strlen(System::getBaseUri());
+ $shortUrlPath = substr(System::getCurrentUri(),$baseUriLenght+1);
+ if (!empty($shortUrlPath) == 0) {
+ self::$cache['modgetname'] = System::getVar('startpage');
+ } else {
+ $args = explode('/', $shortUrlPath);
+ self::$cache['modgetname'] = $args[0];
+ }
+ }
}
// the parameters may provide the module alias so lets get
Something went wrong with that request. Please try again.