Перейти к публикации
View in the app

A better way to browse. Learn more.

Дизайн и модификация Invision Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Фильтр badwords

Опубликовано:

Проблема в следующем, IPB 2.0.3. фильтр запрещённых слов работает не совсем корректно именно в приватных сообщениях, то есть спамер зашедший на форум может попытаться отправить спам остальным участникам через приват, даже если его слово занесено в список badwords в заголовке сообщения приватного письма оно не фильтруется. Собственно сабж, что надо поправить что бы и в приватных сообщениях заголовок письма подпадал под фильтр. Насколько я понял код отвечающий за это находится тут post_parser.php

 

    //-----------------------------------------
   // Badwords:
   // Swops naughty, naugty words and stuff
   //-----------------------------------------

   function bad_words($text = "")
   {
       global $DB, $ibforums;

       if ($text == "")
       {
           return "";
       }

       if ( $this->bypass_badwords == 1 )
       {
           return $text;
       }

       //-----------------------------------------

       if ( is_array( $ibforums->cache['badwords'] ) )
       {
           usort( $ibforums->cache['badwords'] , array( 'post_parser', 'word_length_sort' ) );

           if ( count($ibforums->cache['badwords']) > 0 )
           {
               foreach($ibforums->cache['badwords'] as $idx => $r)
               {

                   if ($r['swop'] == "")
                   {
                       $replace = '######';
                   }
                   else
                   {
                       $replace = $r['swop'];
                   }

                   //-----------------------------------------

                   $r['type'] = preg_quote($r['type'], "/");

                   //-----------------------------------------

                   if ($r['m_exact'] == 1)
                   {
                       $text = preg_replace( "/(^|\B)".$r['type']."(\b|!|\?|\.|,|$)/i", "$replace", $text );
                   }
                   else
                   {
                       $text = preg_replace( "/".$r['type']."/i", "$replace", $text );
                   }
               }
           }
       }

       return $text;

   }

 

 

Возможно я и ошибаюсь, если так, прошу помогите найти код отвечающий за фильтрацию привата и как поправить данную оплошность.

Рекомендованные сообщения

Опубликовано:

./sources/action_public/messenger.php

найти что-то типа

$info['msg_title']   = $r['mt_title'];

 

вставить выше

$r['mt_title']   = $this->msglib->postlib->parser->bad_words( $r['mt_title'] );

 

Это под 2.3 пишу, в 2.0 вызов метода может отличаться

Опубликовано:
  • Автор

Не помогает, попробовал, всё равно заголовок письма не фильтруется. вот код похоже отвечающий за это.

 

         if ( $DB->get_num_rows() )
        {
            while ( $r = $DB->fetch_row() )
            {
                $info = array();

                $msg_ids[] = $r['mt_id'];

                $info['msg_date']    = $std->get_date( $r['mt_date'], 'LONG' );
                $info['msg_title']   = $r['mt_title'];
                $info['msg_sender']  = $r['name'];
                $info['msg_content'] = $this->parser->convert( array( 'TEXT'    => $r['msg_post'],
                                                                     'SMILIES' => 0,
                                                                     'CODE'    => $ibforums->vars['msg_allow_code'],
                                                                     'HTML'    => $ibforums->vars['msg_allow_html']
                                                                   )
                                                            );

                if ($type == 'xls')
                {
                    $output .= '"'.$this->strip_quotes($info['msg_title']).'","'.$this->strip_quotes($info['msg_date']).'","'.$this->strip_quotes($info['msg_sender']).'","'.$this->strip_quotes($info['msg_content']).'"'."\r";
                }
                else
                {
                    if ( $r['vid'] == 'sent' )
                    {
                        $info['msg_sender']  = $r['rec_name'];
                        $output .= $this->html->archive_html_entry_sent($info);
                    }
                    else
                    {
                        $output .= $this->html->archive_html_entry($info);
                    }
                }
            }

            if ($type == 'html')
           {
               $output .= $this->html->archive_html_footer();
           }

           $num_msg = count( $msg_ids );

Изменено пользователем fatal1ty100

Опубликовано:

У парсера тут другая переменная

 

выше вставить

$r['mt_title']   = $this->parser->bad_words( $r['mt_title'] );

Опубликовано:
  • Автор

info?

Изменено пользователем fatal1ty100

Создайте аккаунт или войдите в него для комментирования

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.