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()
3838 }
3939
4040 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+
4547 // No user logged in... no url. We should not get here.
4648 if (!$ user ) {
4749 throw new Stuffpress_Exception ("Unexpected request to base->myUrl() " );
@@ -56,12 +58,17 @@ public function getPublicDomain($cname=true) {
5658 if ($ config ->app ->user && ($ config ->app ->user == $ user ->username )) {
5759 $ host = trim ($ config ->web ->host , " / " );
5860 $ path = trim ($ config ->web ->path , " / " );
59- return "$ host/ $ path " ;
61+
62+ if ($ path ) {
63+ return "$ host/ $ path " ;
64+ } else {
65+ return $ host ;
66+ }
6067 }
6168
6269 // Otherwise, rebuild the URL
6370 return $ user ->username . ". " . $ config ->web ->host ;
6471 }
65-
72+
6673}
6774?>
You can’t perform that action at this time.
0 commit comments