[Fusionforge-commits] r15821 - trunk/src/plugins/scmhg/common

Franck VILLAUME nerville at fusionforge.org
Tue Jun 26 00:24:26 CEST 2012


Author: nerville
Date: 2012-06-26 00:24:26 +0200 (Tue, 26 Jun 2012)
New Revision: 15821

Modified:
   trunk/src/plugins/scmhg/common/HgPlugin.class.php
Log:
fix #452: more check about double slash

Modified: trunk/src/plugins/scmhg/common/HgPlugin.class.php
===================================================================
--- trunk/src/plugins/scmhg/common/HgPlugin.class.php	2012-06-25 14:21:42 UTC (rev 15820)
+++ trunk/src/plugins/scmhg/common/HgPlugin.class.php	2012-06-25 22:24:26 UTC (rev 15821)
@@ -90,7 +90,12 @@
 				$b .= '</p>';
 				// Warning : the ssh uri MUST be this form : ssh://username@scmbox//path/reponame
 				//            HAVE YOU SEEN THE // starting the path ? Keep in mind the double /
-				$b .= '<p><tt>hg clone ssh://'.$d.'@' . $this->getBoxForProject($project) .'/'. forge_get_config('repos_path', 'scmhg') .'/'. $project->getUnixName().'</tt></p>';
+				$boxforproject = $this->getBoxForProject($project);
+				if ('/' != substr($boxforproject, -1)) {
+					// just to be sure, we have double /
+					$boxforproject .= '/';
+				}
+				$b .= '<p><tt>hg clone ssh://'.$d.'@' . $boxforproject .'/'. forge_get_config('repos_path', 'scmhg') .'/'. $project->getUnixName().'</tt></p>';
 			}
 			if (forge_get_config('use_dav', 'scmhg')) {
 				$b .= '<h2>';
@@ -112,7 +117,12 @@
 				$b .= '</p>';
 				// Warning : the ssh uri MUST be this form : ssh://username@scmbox//path/reponame
 				//            HAVE YOU SEEN THE // starting the path ? Keep in mind the double /
-				$b .= '<p><tt>hg clone ssh://'.$d.'@' . $this->getBoxForProject($project) .'/'. forge_get_config('repos_path', 'scmhg') .'/'. $project->getUnixName().'</tt></p>';
+				$boxforproject = $this->getBoxForProject($project);
+				if ('/' != substr($boxforproject, -1)) {
+					// just to be sure, we have double /
+					$boxforproject .= '/';
+				}
+				$b .= '<p><tt>hg clone ssh://'.$d.'@' . $boxforproject .'/'. forge_get_config('repos_path', 'scmhg') .'/'. $project->getUnixName().'</tt></p>';
 			} else {
 				$b = '<h2>';
 				$b .= _('Developer Mercurial Access via HTTP');




More information about the Fusionforge-commits mailing list