Exemplo n.º 1
0
 $userinfo_sigpic = fetch_userinfo($vbulletin->userinfo['userid'], FETCH_USERINFO_SIGPIC);
 // Censored Words
 $censor_signature = fetch_censored_text($signature);
 if ($signature != $censor_signature) {
     $signature = $censor_signature;
     $errors[] = fetch_error('censoredword');
     unset($censor_signature);
 }
 // Max number of images in the sig if imgs are allowed.
 if ($vbulletin->userinfo['permissions']['sigmaximages']) {
     // Parsing the signature into BB code.
     require_once DIR . '/includes/class_bbcode_alt.php';
     $bbcode_parser =& new vB_BbCodeParser_ImgCheck($vbulletin, fetch_tag_list());
     $bbcode_parser->set_parse_userinfo($userinfo_sigpic, $vbulletin->userinfo['permissions']);
     $parsedsig = $bbcode_parser->parse($signature, 'signature');
     $imagecount = fetch_character_count($parsedsig, '<img');
     // Count the images
     if ($imagecount > $vbulletin->userinfo['permissions']['sigmaximages']) {
         $vbulletin->GPC['preview'] = true;
         $errors[] = fetch_error('toomanyimages', $imagecount, $vbulletin->userinfo['permissions']['sigmaximages']);
     }
 }
 // Count the raw characters in the signature
 if ($vbulletin->userinfo['permissions']['sigmaxrawchars'] and vbstrlen($signature) > $vbulletin->userinfo['permissions']['sigmaxrawchars']) {
     $vbulletin->GPC['preview'] = true;
     $errors[] = fetch_error('sigtoolong_includingbbcode', $vbulletin->userinfo['permissions']['sigmaxrawchars']);
 } else {
     if ($vbulletin->userinfo['permissions']['sigmaxchars'] and vbstrlen(strip_bbcode($signature, false, false, false)) > $vbulletin->userinfo['permissions']['sigmaxchars']) {
         $vbulletin->GPC['preview'] = true;
         $errors[] = fetch_error('sigtoolong_excludingbbcode', $vbulletin->userinfo['permissions']['sigmaxchars']);
     }
Exemplo n.º 2
0
 /**
  * Verifies the number of images in the post text. Call it from pre_save() after pagetext/allowsmilie has been set
  *
  * @return	bool	Whether the post passes the image count check
  */
 function verify_image_count($pagetext = 'pagetext', $allowsmilie = 'allowsmilie', $parsetype = 'nonforum', $table = null)
 {
     global $vbulletin;
     $_allowsmilie =& $this->fetch_field($allowsmilie, $table);
     $_pagetext =& $this->fetch_field($pagetext, $table);
     if ($_allowsmilie !== null and $_pagetext !== null) {
         // check max images
         require_once DIR . '/includes/functions_misc.php';
         require_once DIR . '/includes/class_bbcode_alt.php';
         $bbcode_parser = new vB_BbCodeParser_ImgCheck($this->registry, fetch_tag_list());
         $bbcode_parser->set_parse_userinfo($vbulletin->userinfo);
         if ($this->registry->options['maximages'] and !$this->info['is_automated']) {
             $imagecount = fetch_character_count($bbcode_parser->parse($_pagetext, $parsetype, $_allowsmilie, true), '<img');
             if ($imagecount > $this->registry->options['maximages']) {
                 $this->error('toomanyimages', $imagecount, $this->registry->options['maximages']);
                 return false;
             }
         }
     }
     return true;
 }
Exemplo n.º 3
0
     // maximuim size of a 32 bit integer
     eval(standard_error(fetch_error('maxpolltimeout')));
 }
 // check max images|videos
 if ($vbulletin->options['maximages'] or $vbulletin->options['maxvideos']) {
     $img_parser = new vB_BbCodeParser_ImgCheck($vbulletin, fetch_tag_list());
     $parsedmessage = $img_parser->parse($maximgtest . $vbulletin->GPC['pollquestion'], $foruminfo['forumid'], $foruminfo['allowsmilies'], true);
     require_once DIR . '/includes/functions_misc.php';
     if ($vbulletin->options['maximages']) {
         $imagecount = fetch_character_count($parsedmessage, '<img');
         if ($imagecount > $vbulletin->options['maximages']) {
             eval(standard_error(fetch_error('toomanyimages', $imagecount, $vbulletin->options['maximages'])));
         }
     }
     if ($vbulletin->options['maxvideos']) {
         $videocount = fetch_character_count($parsedmessage, '<video />');
         if ($videocount > $vbulletin->options['maxvideos']) {
             eval(standard_error(fetch_error('toomanyvideos', $videocount, $vbulletin->options['maxvideos'])));
         }
     }
 }
 $poll->set('question', $vbulletin->GPC['pollquestion']);
 $poll->set('active', $vbulletin->GPC['closepoll'] ? 0 : 1);
 $poll->set('timeout', $vbulletin->GPC['timeout']);
 // only let a poll go from public to private, not the other way about
 if ($pollinfo['public']) {
     $poll->set('public', $vbulletin->GPC['public']);
 }
 ($hook = vBulletinHook::fetch_hook('poll_update_process')) ? eval($hook) : false;
 $poll->save();
 $pollinfo['threadid'] = $threadinfo['threadid'];
Exemplo n.º 4
0
 }
 if (TIMENOW + $vbulletin->GPC['timeout'] * 86400 >= 2147483647) {
     // maximuim size of a 32 bit integer
     eval(standard_error(fetch_error('maxpolltimeout')));
 }
 // check max images
 if ($vbulletin->options['maximages']) {
     $counter = 0;
     while ($counter++ < $polloptions) {
         // 0..Pollnum-1 we want, as arrays start with 0
         $maximgtest .= $vbulletin->GPC['options']["{$counter}"];
     }
     $img_parser =& new vB_BbCodeParser_ImgCheck($vbulletin, fetch_tag_list());
     $parsedmessage = $img_parser->parse($maximgtest . $question, $foruminfo['forumid'], $foruminfo['allowsmilies'], true);
     require_once DIR . '/includes/functions_misc.php';
     $imagecount = fetch_character_count($parsedmessage, '<img');
     if ($imagecount > $vbulletin->options['maximages']) {
         eval(standard_error(fetch_error('toomanyimages', $imagecount, $vbulletin->options['maximages'])));
     }
 }
 $question = fetch_censored_text($question);
 $counter = 0;
 while ($counter++ < $polloptions) {
     // 0..Pollnum-1 we want, as arrays start with 0
     $vbulletin->GPC['options']["{$counter}"] = fetch_censored_text($vbulletin->GPC['options']["{$counter}"]);
 }
 // Add the poll
 $poll =& datamanager_init('Poll', $vbulletin, ERRTYPE_STANDARD);
 $counter = 0;
 while ($counter++ < $polloptions) {
     if ($vbulletin->GPC['options']["{$counter}"] != '') {
Exemplo n.º 5
0
     require_once DIR . '/includes/class_bbcode_alt.php';
     require_once DIR . '/includes/functions_video.php';
     $bbcode_parser = new vB_BbCodeParser_ImgCheck($vbulletin, fetch_tag_list());
     $bbcode_parser->set_parse_userinfo($userinfo_sigpic, $vbulletin->userinfo['permissions']);
     $signature = parse_video_bbcode($signature);
     $parsedsig = $bbcode_parser->parse($signature, 'signature');
     // Count the images
     if ($vbulletin->userinfo['permissions']['sigmaximages']) {
         $imagecount = fetch_character_count($parsedsig, '<img');
         if ($imagecount > $vbulletin->userinfo['permissions']['sigmaximages']) {
             $vbulletin->GPC['preview'] = true;
             $errors[] = fetch_error('toomanyimages', $imagecount, $vbulletin->userinfo['permissions']['sigmaximages']);
         }
     }
     if ($vbulletin->userinfo['permissions']['sigmaxvideos']) {
         $videocount = fetch_character_count($parsedsig, '<video />');
         if ($videocount > $vbulletin->userinfo['permissions']['sigmaxvideos']) {
             $vbulletin->GPC['preview'] = true;
             $errors[] = fetch_error('toomanyvideos', $videocount, $vbulletin->userinfo['permissions']['sigmaxvideos']);
         }
     }
 }
 // Count the raw characters in the signature
 if ($vbulletin->userinfo['permissions']['sigmaxrawchars'] and vbstrlen($signature) > $vbulletin->userinfo['permissions']['sigmaxrawchars']) {
     $vbulletin->GPC['preview'] = true;
     $errors[] = fetch_error('sigtoolong_includingbbcode', $vbulletin->userinfo['permissions']['sigmaxrawchars']);
 } else {
     if ($vbulletin->userinfo['permissions']['sigmaxchars'] and vbstrlen(strip_bbcode($signature, false, false, false)) > $vbulletin->userinfo['permissions']['sigmaxchars']) {
         $vbulletin->GPC['preview'] = true;
         $errors[] = fetch_error('sigtoolong_excludingbbcode', $vbulletin->userinfo['permissions']['sigmaxchars']);
     }