Mercurial > hg > soundsoftware-site
comparison extra/soundsoftware/SoundSoftware.pm @ 737:1ce6efe3db0e feature_318
Last "fix" was completely bogus. Here's a real one (for situation where URL has nothing beyond the location)
author | Chris Cannam |
---|---|
date | Fri, 04 Nov 2011 16:42:49 +0000 |
parents | 51c97efbe241 |
children | cf4cc816278a |
comparison
equal
deleted
inserted
replaced
736:51c97efbe241 | 737:1ce6efe3db0e |
---|---|
471 | 471 |
472 sub get_project_identifier { | 472 sub get_project_identifier { |
473 my $dbh = shift; | 473 my $dbh = shift; |
474 my $r = shift; | 474 my $r = shift; |
475 my $location = $r->location; | 475 my $location = $r->location; |
476 my $repo = ($r->uri =~ m{$location/*([^/]+)}); | 476 my ($repo) = $r->uri =~ m{$location/*([^/]*)}; |
477 | 477 |
478 return $repo if (!$repo); | 478 return $repo if (!$repo); |
479 | 479 |
480 $repo =~ s/[^a-zA-Z0-9\._-]//g; | 480 $repo =~ s/[^a-zA-Z0-9\._-]//g; |
481 | 481 |
544 if ($name =~ m/^\s*$/) { | 544 if ($name =~ m/^\s*$/) { |
545 # nothing even in $project_id -- probably a nonexistent project. | 545 # nothing even in $project_id -- probably a nonexistent project. |
546 # use repo name instead (don't want to admit to user that project | 546 # use repo name instead (don't want to admit to user that project |
547 # doesn't exist) | 547 # doesn't exist) |
548 my $location = $r->location; | 548 my $location = $r->location; |
549 my $repo = ($r->uri =~ m{$location/*([^/]+)}); | 549 my ($repo) = $r->uri =~ m{$location/*([^/]*)}; |
550 $name = $repo; | 550 $name = $repo; |
551 } | 551 } |
552 | 552 |
553 my $realm = '"Mercurial repository for ' . "'$name'" . '"'; | 553 my $realm = '"Mercurial repository for ' . "'$name'" . '"'; |
554 | 554 |