Error with phpgrid 2.2 and mysql

QuestionsError with phpgrid 2.2 and mysql
Michael Stender asked 7 years ago

Hi Abu,

As soon as I update the file "jqgrid_dist.php" all my tables using mysql stop working.
Code I'm using for testing: https://hastebin.com/jibuxadojo.xml
When I swap the mysql table for an array it works just fine, when I try this code with the 2.1.2 grid version of jqgrid_dist.php it works.

The error I'm getting:
Mixed Content: The page at 'https://www.domain.com/system/agenda/test' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://www.domain.com/home/'. This request has been blocked; the content must be served over HTTPS.

Kind regards,

Michael

3 Answers
Abu Ghufran answered 7 years ago

I am unable to regenerate this issue.

Please try updating complete 'lib' folder from 2.2 zip package.
It will include core library as well as other static files.

If you can share online link, where i can see this issue it will help.

Michael Bawden answered 7 years ago

Think the issue is with the way the current url is collected for the jquery.ajax function.
Code when using the 2.1.2 version:
// Send whole row data in ajax – ends
jQuery.ajax({
url: "https://www.domain.com/system/agenda/test/?grid_id=list1",
dataType: "json",
data: request,
type: "POST",
error: function(res, status) {
alert(res.status+" : "+res.statusText+". Status: "+status);
},
success: function( data ) {
response( data );
}
});

With 2.2:
// Send whole row data in ajax – ends
jQuery.ajax({
url: "?grid_id=list1",
dataType: "json",
data: request,
type: "POST",
error: function(res, status) {
alert(res.status+" : "+res.statusText+". Status: "+status);
},
success: function( data ) {
response( data );
}
});

A quick fix would be for me to add on every grid $opt["url"] = $_SERVER["REQUEST_URI"];
And to disable $this->options["url"] = $this->sanitize_xss_url($this->options["url"]); in jqgrid.dist.php (line 677)

I got RewriteEngine on for my urls, maybe the xss fix struggles with that? When I run one of your demos it works just fine with 2.2. But those urls are not rewritten.

Abu Ghufran answered 7 years ago

I've emailed you fix for sanitize_xss_url function.

Your Answer

4 + 8 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?