Типа я (zilogic) wrote in changelog,
Типа я
zilogic
changelog

[livejournal] r21787: LJSV-2191: Cannot delete Music field fro...

Committer: amyshkin
LJSV-2191: Cannot delete Music field from an entry
U   trunk/cgi-bin/weblib.pl
Modified: trunk/cgi-bin/weblib.pl
===================================================================
--- trunk/cgi-bin/weblib.pl	2012-04-23 15:01:46 UTC (rev 21786)
+++ trunk/cgi-bin/weblib.pl	2012-04-24 07:50:06 UTC (rev 21787)
@@ -1160,21 +1160,19 @@
         $req->{$_} = $POST->{$_};
     }
 
-    if ( $POST->{'prop_current_music'} ) {
-        if ( length( $POST->{'prop_current_music'} ) > 197 ) {
-            my $pos = index( $POST->{'prop_current_music'}, '|' );
+    if ( length( $POST->{'prop_current_music'} ) > 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 );
-            }
+        if ( $pos == -1 ) {
+            $req->{'prop_current_music'} = substr( $POST->{'prop_current_music'}, 0, 197 ) . '...';
         }
         else {
-            $req->{'prop_current_music'} = $POST->{'prop_current_music'};
+            $req->{'prop_current_music'} = substr( substr($POST->{'prop_current_music'}, 0, $pos), 0, 197 ) . '... ' . substr( $POST->{'prop_current_music'}, $pos );
         }
     }
+    else {
+        $req->{'prop_current_music'} = $POST->{'prop_current_music'};
+    }
 
     if ($POST->{"subject"} eq BML::ml('entryform.subject.hint2')) {
         $req->{"subject"} = "";

Tags: amyshkin, livejournal, pl, zilogic
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments