web-dev-qa-db-ja.com

SocialEngineで約675文字後にコメントが予期せずに切り捨てられる

ユーザーがSocialEngine Webサイトにコメントを投稿すると、約670文字でコメントが予期せず切り捨てられます。

誰もこのバグを以前に経験しましたか?

コメントは元の切り捨てられていない状態でデータベースに保存されるので、modules/Core/controllers/CommentController.phpのどこかにバグがあると思います。しかし、コードを数時間精査した後、私は答えを見つけることに近づいていません。

1
DMCoding

ルールのミニ機能を壊すために、バグが新しい行にあるようです。 /application/libraries/Engine/View/Helper/ViewMore.phpの24行目を変更します。

protected $_maxLineBreaks = 4; // Truncate early if more than this nl

12へ。機能を完全に削除することなく、今のところ問題を修正します。また、ルール機能を解除する新しい行が、宣伝どおりに機能しないことに気付きました。行41〜55の変更:

// If using line breaks, ensure that there are not too many line breaks
if( $nl2br ) {
  $string = trim(preg_replace('/[\r\n]+/', "\n", $string));
  if( ($c = substr_count($string, "\n")) > $this->_maxLineBreaks) {
    $pos = 0;
    for( $i = 0; $i < $this->_maxLineBreaks; $i++ ) {
      $pos = strpos($string, "\n", $pos + 1);
    }
    if( $pos <= 0 || !is_int($pos) ) {
      $pos = null;
    }
    if( $pos && $pos < $moreLength ) {
      $moreLength = $pos;
    }
  }
}

if( $nl2br ) {
    $string = preg_replace('{(<br[^>]*>\s*)+}', '<br>', nl2br($string));
}

56〜60行目を完全に削除するとうまく機能するようです。

1
DMCoding