File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
protected/library/Stuffpress Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -38,10 +38,12 @@ public static function _unsetInstance()
38
38
}
39
39
40
40
public function getPublicDomain ($ cname =true ) {
41
- $ config = Zend_Registry::get ("configuration " );
42
-
43
- $ user = $ this ->user ;
44
-
41
+ return Stuffpress_Application::getDomain ($ this ->user , $ cname );
42
+ }
43
+
44
+ public static function getDomain ($ user , $ cname =true ) {
45
+ $ config = Zend_Registry::get ("configuration " );
46
+
45
47
// No user logged in... no url. We should not get here.
46
48
if (!$ user ) {
47
49
throw new Stuffpress_Exception ("Unexpected request to base->myUrl() " );
@@ -56,12 +58,17 @@ public function getPublicDomain($cname=true) {
56
58
if ($ config ->app ->user && ($ config ->app ->user == $ user ->username )) {
57
59
$ host = trim ($ config ->web ->host , " / " );
58
60
$ path = trim ($ config ->web ->path , " / " );
59
- return "$ host/ $ path " ;
61
+
62
+ if ($ path ) {
63
+ return "$ host/ $ path " ;
64
+ } else {
65
+ return $ host ;
66
+ }
60
67
}
61
68
62
69
// Otherwise, rebuild the URL
63
70
return $ user ->username . ". " . $ config ->web ->host ;
64
71
}
65
-
72
+
66
73
}
67
74
?>
You can’t perform that action at this time.
0 commit comments