Index: trunk/phase3/includes/RecentChange.php |
— | — | @@ -613,8 +613,10 @@ |
614 | 614 | $url = $titleObj->getInternalURL(); |
615 | 615 | } else if( $wgUseRCPatrol ) { |
616 | 616 | $url = $titleObj->getInternalURL("diff=$rc_this_oldid&oldid=$rc_last_oldid&rcid=$rc_id"); |
| 617 | + $url = preg_replace('/title=[^&]*&/', '', $url); |
617 | 618 | } else { |
618 | 619 | $url = $titleObj->getInternalURL("diff=$rc_this_oldid&oldid=$rc_last_oldid"); |
| 620 | + $url = preg_replace('/title=[^&]*&/', '', $url); |
619 | 621 | } |
620 | 622 | |
621 | 623 | if( isset( $oldSize ) && isset( $newSize ) ) { |
— | — | @@ -643,6 +645,20 @@ |
644 | 646 | # no colour (\003) switches back to the term default |
645 | 647 | $fullString = "\00314[[\00307$title\00314]]\0034 $flag\00310 " . |
646 | 648 | "\00302$url\003 \0035*\003 \00303$user\003 \0035*\003 $szdiff \00310$comment\003\n"; |
| 649 | + # RFC 2812 sets the limit for IRC message length at 512 bytes |
| 650 | + # If the message is longer than that, trim the comment as much as necessary |
| 651 | + # It might still be too long, but there's not much else we can trim without losing anything important |
| 652 | + if ( strlen($fullString) > 512 ) { |
| 653 | + $extra = strlen($fullString) - 512; |
| 654 | + if ( strlen($comment) > $extra ) { |
| 655 | + $comment = substr($comment, 0, strlen($comment) - $extra); |
| 656 | + } else { |
| 657 | + $comment = ''; |
| 658 | + } |
| 659 | + $fullString = "\00314[[\00307$title\00314]]\0034 $flag\00310 " . |
| 660 | + "\00302$url\003 \0035*\003 \00303$user\003 \0035*\003 $szdiff \00310$comment\003\n"; |
| 661 | + } |
| 662 | + |
647 | 663 | return $fullString; |
648 | 664 | } |
649 | 665 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -287,6 +287,8 @@ |
288 | 288 | * (bug 12764) Special:LonelyPages shows transcluded pages |
289 | 289 | * (bug 16073) Enhanced RecentChanges uses onclick handler with better fallback if |
290 | 290 | JavaScript is disabled. |
| 291 | +* (bug 4253) Recentchanges IRC messages no longer include title in diff URLs and |
| 292 | + the comment is trimmed if necessary to maintain proper message length. |
291 | 293 | |
292 | 294 | === API changes in 1.14 === |
293 | 295 | |