Committer: amyshkin
LJSUP-11810: Change the widget trava.ruU trunk/cgi-bin/weblib.pl
Modified: trunk/cgi-bin/weblib.pl =================================================================== --- trunk/cgi-bin/weblib.pl 2012-04-16 15:19:28 UTC (rev 21724) +++ trunk/cgi-bin/weblib.pl 2012-04-17 05:38:09 UTC (rev 21725) @@ -1162,7 +1162,14 @@ if ( $POST->{'prop_current_music'} ) { if ( length( $POST->{'prop_current_music'} ) > 197 ) { - $req->{'prop_current_music'} = substr( $POST->{'prop_current_music'}, 0, 197 ) . '...'; + my $pos = index( $POST->{'prop_current_music'}, '|' ); + + if ( $pos == -1 ) { + $req->{'prop_current_music'} = substr( $POST->{'prop_current_music'}, 0, 197 ) . '...'; + } + else { + $req->{'prop_current_music'} = substr( substr($POST->{'prop_current_music'}, 0, $pos), 0, 197 ) . '...' . substr( $POST->{'prop_current_music'}, $pos + 1 ); + } } else { $req->{'prop_current_music'} = $POST->{'prop_current_music'};