vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r17678: LJSUP-7318: get rid of $&

Committer: vsukhanov
LJSUP-7318: get rid of $&
U   trunk/cgi-bin/LJ/Entry.pm
Modified: trunk/cgi-bin/LJ/Entry.pm
===================================================================
--- trunk/cgi-bin/LJ/Entry.pm	2010-11-13 10:03:21 UTC (rev 17677)
+++ trunk/cgi-bin/LJ/Entry.pm	2010-11-13 10:40:16 UTC (rev 17678)
@@ -849,10 +849,10 @@
 
     # assume the first paragraph is terminated by two <br> or a </p>
     # valid XML tags should be handled, even though it makes an uglier regex
-    if ($event =~ m!((<br\s*/?\>(</br\s*>)?\s*){2})|(</p\s*>)!i) {
+    if ($event =~ m!(.*)(((<br\s*/?\>(</br\s*>)?\s*){2})|(</p\s*>))!i) {
         # everything before the matched tag + the tag itself
         # + a link to read more
-        $event = $` . $& . $readmore;
+        $event = $1 . $2 . $readmore;
     }
     return $event;
 }

Tags: livejournal, pm, vadvs
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 

  • 1 comment