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

[livejournal] r23361: LJSUP-14301: Save props for reposted ent...

Committer: amyshkin
LJSUP-14301: Save props for reposted entries
U   trunk/cgi-bin/cleanhtml.pl
U   trunk/htdocs/update.bml
Modified: trunk/cgi-bin/cleanhtml.pl
===================================================================
--- trunk/cgi-bin/cleanhtml.pl	2012-11-26 11:47:50 UTC (rev 23360)
+++ trunk/cgi-bin/cleanhtml.pl	2012-11-26 13:25:40 UTC (rev 23361)
@@ -1433,8 +1433,8 @@
                 } else {
                     $newdata .= "<a name='cutid$cutcount-end'></a>"
                 }
-            }
-            elsif ($tag eq "lj-repost" and $ljrepost_allowed and ref $opencount{$tag}){
+            } #'"
+            elsif ($tag eq "lj-repost" and $ljrepost_allowed and ref $opencount{$tag}) {
                 ## Add repost button
                 ## If there is opening <lj-repost> tag than $opencount{$tag} exists.
                 ##
@@ -1470,20 +1470,26 @@
                     $captured = Encode::decode_utf8($captured);
                     $subject  = Encode::decode_utf8($subject) if $subject;
                 }
+
                 $captured = LJ::ehtml($captured);
 
                 # add <form> with invisible fields and visible submit button
-                if ($captured){
-                    $newdata .= qq[<form action="http://www.$LJ::DOMAIN/update.bml" method="POST">
+                if ( $captured ) {
+                    $newdata .= qq[
+                      <form action="http://www.$LJ::DOMAIN/update.bml" method="POST">
                         <div style="display:none;visible:false">
                         <input type="text" name="subject" value="$subject" />
                         <textarea name="event">$captured</textarea>
+                        <input type="hidden" name="repost" value="$opts->{cuturl}" />
+                        <input type="hidden" name="repost_type" value="a" />
                         </div>
-                        <input type="submit" value="$button" /></form>];
+                        <input type="submit" value="$button" />
+                      </form>];
                 } else {
                     ## treat <lj-repost></lj-repost> as <lj-repost />
                     $newdata .= qq[<form action="http://www.$LJ::DOMAIN/update.bml" method="GET">]
-                             .  qq[<input type=hidden name="repost" value="$opts->{cuturl}" />]
+                             .  qq[<input type="hidden" name="repost" value="$opts->{cuturl}" />]
+                             .  qq[<input type="hidden" name="repost_type" value="a" />]
                              .  qq(<input type="submit" value="$button" /> )
                              .  qq[</form>];
                 }

Modified: trunk/htdocs/update.bml
===================================================================
--- trunk/htdocs/update.bml	2012-11-26 11:47:50 UTC (rev 23360)
+++ trunk/htdocs/update.bml	2012-11-26 13:25:40 UTC (rev 23361)
@@ -204,7 +204,7 @@
             return;
         }
 
-        if ($entry->visible_to($remote)){
+        if ($entry->visible_to($remote)) {
             $subject ||= (LJ::ehtml($entry->subject_orig) || LJ::Lang::ml("repost.default_subject"));
 
             unless ($event) {
@@ -219,9 +219,10 @@
                         subject  => $subject,
                         text     => $event,
                 });
-                $reposted_from = $entry->url;
-                $repost_hidden = LJ::repost_auth($POST{'repost_type'} || $GET{'repost_type'} || 'd', $entry->poster->username, $entry->url, $subject);
             }
+
+            $reposted_from = $entry->url;
+            $repost_hidden = LJ::repost_auth($POST{'repost_type'} || $GET{'repost_type'} || 'd', $entry->poster->username, $entry->url, $subject);
         }
     }
 

Tags: amyshkin, bml, 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