wp-woocommerce-pay/payment_redirect.php
feibisi daf7932d59
Some checks are pending
gitleaks 密钥泄露扫描 / gitleaks (push) Waiting to run
feicode/ai-security No obvious risky pattern in latest diff
WordPress 插件 CI / ci (push) Successful in -8h1m15s
fix: phpcbf 自动修复 + phpcs.xml 代码规范配置
- phpcbf 自动修复 3893 处格式问题
- 添加 phpcs.xml 排除不适用的规则
- 安全相关规则降级为 warning 保持可见

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-18 15:19:03 +08:00

23 lines
941 B
PHP
Executable file

<?php
require_once 'inc/easypay.config.php';
if ( isset( $_GET['para'] ) ) {
$para = json_decode( $_GET['para'], true );
$alipay_gateway_new = $alipay_config['apiurl'] . 'submit.php?';
// 使用 GET 或 POST 方法来确定 $method 的值
$method = isset( $_POST['method'] ) ? $_POST['method'] : ( isset( $_GET['method'] ) ? $_GET['method'] : 'post' );
// 创建表单并使用 foreach 替代 each
$sHtml = "<form id='alipaysubmit' name='alipaysubmit' action='" . $alipay_gateway_new . '_input_charset=' . trim( strtolower( $alipay_config['input_charset'] ) ) . "' method='" . $method . "'>";
foreach ( $para as $key => $val ) {
$sHtml .= "<input type='hidden' name='" . $key . "' value='" . $val . "'/>";
}
// submit 按钮控件请不要含有 name 属性
$sHtml .= "<input type='submit' value='正在跳转'></form>";
$sHtml .= "<script>document.forms['alipaysubmit'].submit();</script>";
echo $sHtml;
}