403Webshell
Server IP : 199.250.200.62  /  Your IP : 216.73.217.89
Web Server : Apache
System : Linux vps37394.inmotionhosting.com 3.10.0-1160.119.1.vz7.224.4 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
User : jasonp18 ( 1000)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /home/jasonp18/www/wp-content/plugins/formidable-pro/classes/models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/jasonp18/www/wp-content/plugins/formidable-pro/classes/models/FrmProComment.php
<?php

if ( ! defined( 'ABSPATH' ) ) {
	die( 'You are not allowed to call this page directly.' );
}

class FrmProComment {
	public static function create_comment( $entry_id, $form_id ) {
		$comment_post_ID = isset($_POST['comment_post_ID']) ? (int) $_POST['comment_post_ID'] : 0;

		$post = get_post($comment_post_ID);

		if ( empty( $post->comment_status ) ) {
			return;
		}

		// get_post_status() will get the parent status for attachments.
		$status = get_post_status($post);

		$status_obj = get_post_status_object($status);

		if ( ! comments_open( $comment_post_ID ) ) {
			do_action('comment_closed', $comment_post_ID);
			//wp_die( __( 'Sorry, comments are closed for this item.') );
			return;
		} else if ( 'trash' == $status ) {
			do_action('comment_on_trash', $comment_post_ID);
			return;
		} else if ( ! $status_obj->public && ! $status_obj->private ) {
			do_action('comment_on_draft', $comment_post_ID);
			return;
		} else if ( post_password_required($comment_post_ID) ) {
			do_action('comment_on_password_protected', $comment_post_ID);
			return;
		} else {
			do_action('pre_comment_on_post', $comment_post_ID);
		}

		$comment_content      = ( isset($_POST['comment']) ) ? trim($_POST['comment']) : '';

		// If the user is logged in
		$user_ID = get_current_user_id();
		if ( $user_ID ) {
			global $current_user;

			$display_name = ( ! empty( $current_user->display_name ) ) ? $current_user->display_name : $current_user->user_login;
			$comment_author       = $display_name;
			$comment_author_email = ''; //get email from field
			$comment_author_url   = $current_user->user_url;
		} else {
			$comment_author       = ( isset( $_POST['author'] ) ) ? trim( strip_tags( $_POST['author'] ) ) : '';
			$comment_author_email = ( isset( $_POST['email'] ) ) ? trim( $_POST['email'] ) : '';
			$comment_author_url   = ( isset( $_POST['url'] ) ) ? trim( $_POST['url'] ) : '';
		}

		$comment_type = '';

		if ( ! $user_ID && get_option( 'require_name_email' ) && ( 6 > strlen($comment_author_email) || $comment_author == '' ) ) {
			return;
		}

		if ( $comment_content == '' ) {
			return;
		}

		$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'user_ID');

		wp_new_comment( $commentdata );

	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit