跳至内容

欢迎!

This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

此问题已终结
作为版主,您可以批准或拒绝该答案。
接受 拒绝
41 查看

When you found some extra parameter in ur ajax url when it run

You can go to check the plugin code

then u can see it using $_REQUEST to getting parameter, which will get the extra parameter for the url


Way to fix:

use Joomla's input handling method to getting the url parameter

// Get Joomla input

$input = Factory::getApplication()->input;


// Debugging: Log POST data

$myfile = fopen("kiple_debug1.txt", "a") or die("Unable to open file!");

fwrite($myfile, print_r($input->post->getArray(), true));


// Check if callback is true


$callback = $input->get('callback', '', 'string');

if ($callback == "true") {

$myfile = fopen("kiple_callback_debug1.txt", "a") or die("Unable to open file!");

fwrite($myfile, print_r($input->post->getArray(), true));


$myfile = fopen("kiple_callback_debug2.txt", "a") or die("Unable to open file!");

fwrite($myfile, print_r($input->getArray(), true));

}

============================================================

Using this method, u can avoid system getting extra parameter for the url


Keypoint:

assign variable to $input->get('callback', '', 'string'); before using it is better since $input->get('callback', '', 'string'); is a method. If assign it to a variable before comparing it, can save system loading time.


Summary:

If you found ur url getting parameter, first step can check whether u r using $_REQUEST to get parameter or not.

形象
丢弃

您的回复

请大家尽量给个实质性的回答。如果您想回答这个问题或发表评论,只需 使用评论工具。请记住,您可以随时修改您的答案。 - 不用重复回答同样的问题。另外,请不要忘记投票 - 它确实有助于选择最好的问题和答案!

相关帖文 回复 查看 活动
0
3月 25
47
0
3月 25
32
0
2月 25
72
0
2月 25
55
0
3月 24
72