Changeset 917

Show
Ignore:
Timestamp:
03/16/02 22:34:31 (11 years ago)
Author:
bradfitz
Message:

formatting clean-ups, and an LJFUNC fix

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/ljlib.pl

    r914 r917  
    596596# des-url: An optional URL of what the client hit. 
    597597# </LJFUNC> 
    598 sub send_statserv { 
     598sub send_statserv 
     599{ 
    599600    my $user = shift; 
    600601    my $ip = shift; 
     
    53525353# returns: nothing. 
    53535354# </LJFUNC> 
    5354 sub text_out { 
     5355sub text_out 
     5356{ 
    53555357    my $rtext = shift; 
    53565358 
     
    53695371# name: LJ::text_in 
    53705372# des: do appropriate checks on input text. Should be called on all 
    5371 # user-generated text. 
     5373#      user-generated text. 
    53725374# args: text 
    53735375# des-text: text to check 
    53745376# returns: 1 if the text is valid, 0 if not. 
    53755377# </LJFUNC> 
    5376 sub text_in { 
     5378sub text_in 
     5379{ 
    53775380    my $text = shift; 
    53785381    return 1 unless $LJ::UNICODE; 
     
    53945397# returns: converted text or undef on error 
    53955398# </LJFUNC> 
    5396  
    5397 sub text_convert { 
     5399sub text_convert 
     5400{ 
    53985401    my ($dbs, $text, $u, $error) = @_; 
    53995402 
     
    54055408        unless %LJ::CACHE_ENCODINGS; 
    54065409 
    5407     if ($u->{'oldenc'} == 0 ||  
     5410    if ($u->{'oldenc'} == 0 || 
    54085411        not defined $LJ::CACHE_ENCODINGS{$u->{'oldenc'}}) { 
    54095412        $$error = 1; 
    54105413        return undef; 
    54115414    }; 
    5412      
     5415 
    54135416    # convert! 
    54145417    my $name = $LJ::CACHE_ENCODINGS{$u->{'oldenc'}}; 
     
    54325435# des-char_max: maximum allowed length in chars; if 0, there's no restriction 
    54335436# returns: the truncated string. 
    5434  
    5435 sub text_trim { 
    5436  
     5437sub text_trim 
     5438{ 
    54375439    my ($text, $byte_max, $char_max) = @_; 
    54385440    return $text unless $byte_max or $char_max; 
     
    54485450        last unless $char_max; 
    54495451        last if $cur + length($1) > $byte_max and $byte_max; 
    5450         $cur += length($1);  
     5452        $cur += length($1); 
    54515453        $char_max--; 
    54525454    } 
    54535455    return substr($text,0,$cur); 
    54545456} 
    5455          
     5457 
    54565458# <LJFUNC> 
    54575459# name: LJ::item_toutf8 
     
    54655467# des-props: hashref of the item's props 
    54665468# returns: nothing. 
    5467  
    5468 sub item_toutf8 { 
     5469sub item_toutf8 
     5470{ 
    54695471    my ($dbs, $u, $subject, $text, $props) = @_; 
    54705472    return unless $LJ::UNICODE;