HEX
Server: nginx/1.24.0
System: Linux ht2024073053593 5.14.0-480.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 12 20:45:27 UTC 2024 x86_64
User: root (0)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/njmuedu.com/jiekou.php
<?php
// 此为Wordpress免费版发布接口,只可以发布标题,内容,TAG

// 加载接口所必需的文件
@header('Content-Type: text/html; charset=UTF-8');
require('./wp-load.php');
require_once(ABSPATH . 'wp-admin/includes/admin.php');
@extract($_REQUEST,EXTR_OVERWRITE);

$pw = '6b5R4S3s2K1i';
if(strcmp($pw,$_GET['pw']) != 0){
	exit('发布接口密码错误!');
}
// 刷新分类列表
if (empty($post_title)) {
	wp_dropdown_categories(array(
		'hide_empty' => 0, 
		'hide_if_empty' => false, 
		'taxonomy' => 'category', 
		'name' => 'parent', 
		'orderby' => 'name', 
		'hierarchical' => true, 
		'show_option_none' => __('None'))
	);
	exit();
}

$post_time =  time() ;

// 初始化发贴信息
$post_info = array(
	'post_status' => 'publish', 
	'post_type' => 'post', 
	'post_author' => 1,
	'ping_status' => get_option( 'default_ping_status' ), 
	'comment_status' => get_option( 'default_comment_status' ),
	'post_pingback' => get_option( 'default_pingback_flag' ),
	'post_parent' => 0,
	'menu_order' => 0, 
	'to_ping' => '', 
	'pinged' => '', 
	'post_password' => '',
	'guid' => '', 
	'post_content_filtered' => '', 
	'post_excerpt' => $post_excerpt, 
	'import_id' => 0,
	'post_content' => $post_content, 
	'post_title' => $post_title, 
	'post_category' => array($post_category_id),
	'post_name' => trim($post_name),
	'post_date_gmt' => get_gmt_from_date(gmdate('Y-m-d H:i:s', $post_time + ( get_option( 'gmt_offset' ) * 3600 ))),
	'post_date' => gmdate('Y-m-d H:i:s', $post_time + ( get_option( 'gmt_offset' ) * 3600 )), 
	'tags_input' => array_unique(array_filter(explode(',', $tags))),
);

// 发布文章
$pid = wp_insert_post($post_info); 
if ($pid) {
	echo "[OK] $pid Ok";
} else {
	exit('error');
}
?>