EDIT: I made the changes and made it available here: [-link-]
Good stuff - It would be good if others could contact plugin developers to get the security holes closed, it's a shame to see good plugins being abandoned, when it can literally be a simple task of informing the developer of the exploit used so it can be closed.
Pete I have admin rights at plugins.e107 and pm's were sent to most (not all) plugin makers when they were withdrawn and few responded with fixes I'm afraid.
First I replaced the old version folder with the new version, and the map doesn't load anymore, so then I decided to apply this fix manually to mapmejs.php, but I have the same problem, the map doesn't load up on users profiles with this change in place.
Nothing was changed between 1.3 and 1.4 that would have broken it.
I can report that changing:
$_GET['u'];
to:
1.$uid = settype($_GET['u'], 'integer');
2. if(!is_int($uid)) die("//invalid user id");
Does break mapme on my website in the user profile page.
Without the change, the map is displayed on each users profile, and with that change in place, the area where the map should be is blank. swata4 confirmed the same thing in this thread.
Cause when you do both you'll 'over do' it. I'll try to explain it as clear as I can.
Start by looking at the second method.
$uid = $_GET['u']; to $uid = intval($_GET['u']); activates an inbuilt protection from e107 It makes sure the input (the GET variable) is not malicious and it prepares it for safe usage. It takes the GET variable, it checks its validity, and it stores the safe value in the $uid variable. Once done, the $uid variable is considered as safe.
Now look at the first method. Instead of making sure the $uid variable is safe before even starting to build up a query (= request to mysql - the database where everything is stored), it does so in the query itself. You see: "gmarkers.user_id = ".$uid." and " is changed in "gmarkers.user_id = ".intval($uid)." and"
If you'd apply both methods at the same time; you'd get something like this: gmarkers.user_id = ".intval(intval($_GET['u']); )."
Its double
Hope that clears it up, just ask if you want more info
I would prefer the second method as you can then use the variable safely elsewhere in the code without creating vulnerabilities if you happen to forget to add the security using method one.
As Moc said, they both do the same thing. The second method just, as Moc said, allows you to safely use $uid in other queries.
I added it at the last minute because it will be easier for people who don't understand coding that well to implement without causing errors by missing something.