Committer: wisest-owl
LJSUP-13571: Create lj tag 'lj-random' for postsU trunk/cgi-bin/cleanhtml.pl
Modified: trunk/cgi-bin/cleanhtml.pl =================================================================== --- trunk/cgi-bin/cleanhtml.pl 2012-09-07 13:46:31 UTC (rev 22841) +++ trunk/cgi-bin/cleanhtml.pl 2012-09-07 13:51:16 UTC (rev 22842) @@ -839,6 +839,15 @@ $newdata .= "<b>[Unknown LJ tag]</b>"; } } + elsif ($tag eq "lj-random") + { + my $max = abs($attr->{'max'}) || 10_000_000; + my $min = abs($attr->{'min'}) || 0; + if ($max < $min) { + ($max, $min) = ($min, $max); + } + $newdata .= int(rand($max-$min)) + $min; + } elsif ($tag eq "lj-raw") { # Strip it out, but still register it as being open