• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

keitaircメインレポジトリ


Commit MetaInfo

修订版1b7e45ccc788a25c75271282b4af23553ba834ee (tree)
时间2010-11-30 22:38:20
作者ISHIKAWA Mutsumi <ishikawa@hanz...>
CommiterISHIKAWA Mutsumi

Log Message

fix undefined var handling

更改概述

差异

--- a/lib/Keitairc/IrcBuffer.pm
+++ b/lib/Keitairc/IrcBuffer.pm
@@ -369,13 +369,16 @@ sub update_stream {
369369 $message =~ s/\s+$//;
370370 $message =~ s/\s+/ /g;
371371
372- my $formatted ='<li class="messagenew"><span class="nick">' . $me->format_time($time) . ' ' . $me->simple_escape($who) . '</span>' . $message . '</li>';
372+ $enc_who = (defined $who && length($who) ? $me->simple_escape($who) ? '');
373+
374+ my $formatted = '<li class="messagenew"><span class="nick">' . $me->format_time($time) . ' ' . $enc_who . '</span>' . $message . '</li>';
373375
374376 my $value = encode_json({cid => $cid,
375377 time => $time,
376378 message => $message,
377379 who => $who,
378380 formatted => $formatted});
381+
379382 $me->send_stream($cid, $value);
380383 }
381384