FILTER_VALIDATE_INT, 'vid' => FILTER_VALIDATE_INT, 'thepost' => FILTER_SANITIZE_STRING ); $sanitizeinputs = filter_input_array(INPUT_POST, $args); $pathtopurifier=$_SERVER["DOCUMENT_ROOT"].'/include/htmlpurifier/library/'; require_once $pathtopurifier.'HTMLPurifier.includes.php'; //require_once $pathtopurifier.'HTMLPurifier.auto.php'; $config = HTMLPurifier_Config::createDefault(); $config->set('HTML.Allowed', 'b,i,br,img'); $config->set('HTML.AllowedAttributes', 'src,alt'); $purifier = new HTMLPurifier($config); $thepost=$_POST['thepost']; $vidid=$_POST['vid']; $userid=$_POST['uid']; $username=$_POST["username"]; $userphoto=$_POST["userphoto"]; $thepost=str_replace("’", "'", $thepost); $thepost=str_replace("“", '"', $thepost); $thepost=str_replace("â€", "'", $thepost); $thepost=str_replace("‘", "'", $thepost); $thepost=str_replace("…", "...", $thepost); $thepost=str_replace("—", "-", $thepost); $thepost=str_replace("–", "-", $thepost); $thepost=str_replace("😜", " ", $thepost); $thepost=filter_words($thepost); $thepost = $purifier->purify($thepost); $em=""; $sql=sprintf("INSERT INTO `mms_comments` (`mms_comments`.`vid`,`mms_comments`.`userid`,`mms_comments`.`thecomment`, `mms_comments`.`thedate`) VALUES (%s,%s,%s,UTC_TIMESTAMP())", GetSQLValueString($vidid, "int"), GetSQLValueString($userid, "int"), GetSQLValueString($thepost, "text")); $query=$database->database_query($sql) or $em=$em.$database->database_error(); $mmsid=$database->database_insert_id(); $now = time(); $ndate = date('Y-m-d H:i:s',$now); $number = (((int)($userid/1000))*1000)+1000; if($userphoto=="") { $uimage="/images/nophoto.png"; } else { $uimage="/uploads_user/".$number."/".$userid."/".$userphoto; $thepath = pathinfo($uimage); $uimage_thumb="/uploads_user/".$number."/".$userid."/".$thepath['filename']."_thumb.".$thepath['extension']; $uimage_thumb_file=$_SERVER["DOCUMENT_ROOT"]. "/uploads_user/".$number."/".$userid."/".$thepath['filename']."_thumb.".$thepath['extension']; if (file_exists($uimage_thumb_file)) {$uimage=$uimage_thumb;} else {} } $thecomment=""; $thecomment=$thecomment.'