Commit 3a985de4 authored by Thomas Sibley's avatar Thomas Sibley
Browse files

Bullet-proofed the ID generation

git-svn-id: svn+ssh://svn.bestpractical.com/svn/bps-public/rt/branches/3.5-TESTING@3427 e417ac7c-1bcc-0310-8ffa-8f5827389a85
parent 7aab2e48
......@@ -63,9 +63,7 @@ $contentbg => "#dddddd"
$color => "#336699"
$id => undef
</%ARGS>
<%once>
my $cache;
</%once>
<%init>
#
# This should be pretty bulletproof
......@@ -75,7 +73,7 @@ my $tid = "TitleBox--$page--" .
join '--', ($class, $bodyclass, $title, $id);
my $i = 0;
$i++ while $cache->{"$tid-$i"};
$cache->{"$tid-$i"}++;
$i++ while $m->notes("$tid-$i");
$m->notes("$tid-$i" => 1);
$tid = "$tid-$i";
</%init>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment