Bugfix: [ 996592 ] Fixed Infinite loop in Page.pm makeUnique in 6.1.1

This commit is contained in:
Len Kranendonk 2004-08-09 08:36:09 +00:00
parent 7f2dab08fa
commit 0ba6b7c911
2 changed files with 4 additions and 2 deletions

View file

@ -30,6 +30,8 @@
- Bugfix: [ 1000299 ] laodAllConfigs should be loadAllConfigs?
- Bugfix: [ 995088 ] Error in printable macro 6.1.1
- Bugfix: [ 1003511 ] Users cannot be added to Registered Users if removed
- Bugfix: [ 996592 ] Fixed Infinite loop in Page.pm makeUnique in 6.1.1
6.1.1
- bugfix [ 991313 ] Manage Translations doesn't work

View file

@ -971,11 +971,11 @@ The page id of the page you're creating a URL for.
sub makeUnique {
my $url = $_[0] || "_1";
my $pageId = $_[1] || "new";
my $where = "where urlizedTitle=".quote($url);
my $where;
unless ($pageId eq "new") {
$where .= " and pageId<>".$pageId;
}
while (my ($test) = WebGUI::SQL->quickArray("select urlizedTitle from page ".$where)) {
while (my ($test) = WebGUI::SQL->quickArray("select urlizedTitle from page where urlizedTitle=".quote($url).$where)) {
if ($url =~ /(.*)(\d+$)/) {
$url = $1.($2+1);
} elsif ($test ne "") {