I just took a look at this
evb thing and what I see here is either a bug or an oversight ... not too sure how to catagorize it.
The Problem is as the
EVB stands now if you use this in
cms sites like joomla/drupal ect with complex urls, it only returns a fragment of the URL to the button. When this happens a proper URL cannot be submitted neither can the button determine if the link already exists at the pligg site being submitted too, by reason that the button craps out on getting a correct url.
in button.php I see
Code:
function pliggit() {
var check = window.parent.submit_url;
if(!check) {
//var url1 = document.URL;
var url1 = encodeURIComponent(location.href);
} else {
var url1 = window.parent.submit_url;
}
<?php if($url_mod == 1) { ?>
url1 = url1.replace(/http:\/\//i,'');
<?php } ?>
var url2 = '<?php echo $server; ?>/evb/url.php?url='+url1;
document.write('<iframe name="pliggit" width="54" height="71" scrolling="no" frameborder="0" src="'+url2+'"></iframe>');
} I think encodeURIComponent(location.href) should be used instead of document.URL as this returns a properly encoded url to the button.
so we should have
Code:
function pliggit() {
var check = window.parent.submit_url;
if(!check) {
//var url1 = document.URL;
var url1 = encodeURIComponent(location.href);
} else {
var url1 = window.parent.submit_url;
}
<?php if($url_mod == 1) { ?>
url1 = url1.replace(/http:\/\//i,'');
<?php } ?>
var url2 = '<?php echo $server; ?>/evb/url.php?url='+url1;
document.write('<iframe name="pliggit" width="54" height="71" scrolling="no" frameborder="0" src="'+url2+'"></iframe>');
} What I am not sure about is window.parent.submit_url. What is that what is it used for what does it mean?
Moving on to url.php. Since we now have a properly formated formated url there is no reason to stip_tags or htmlspecialcharters
hence...
Code:
$url = htmlspecialchars(strip_tags($_GET['url']));
can simply be ..
Code:
//$url = htmlspecialchars(strip_tags($_GET['url']));
$url = $_GET['url'];
Out of curiosity has anyone used this with joomla? any problems? as its still corrupting the url on submission.
Has this been tested with
CMS systems at all? It just isnt working. Only for urls that are simple with out long query strings.