fix: links with parameters get cut off at &

This commit is contained in:
Arthur Schiwon 2011-08-25 13:51:48 +02:00
parent e5681311b8
commit b5e47ae36f
8 changed files with 10 additions and 10 deletions

View File

@ -51,9 +51,9 @@ $query = OC_DB::prepare("
$params=array(
urldecode($_GET["url"]),
urldecode($_GET["title"]),
urldecode($_GET["description"]),
htmlspecialchars_decode($_GET["url"]),
htmlspecialchars_decode($_GET["title"]),
htmlspecialchars_decode($_GET["description"]),
OC_User::getUser()
);
$query->execute($params);

View File

@ -36,7 +36,7 @@ if( !OC_User::isLoggedIn()){
}
$params=array(
urldecode($_GET["url"]),
htmlspecialchars_decode($_GET["url"]),
OC_User::getUser()
);

View File

@ -38,7 +38,7 @@ if( !OC_User::isLoggedIn()){
// $metadata = array();
require '../bookmarksHelper.php';
$metadata = getURLMetadata(htmlspecialchars_decode($_GET["url"]));
$metadata = getURLMetadata(urldecode($_GET["url"]));
echo json_encode( array( 'status' => 'success', 'data' => $metadata));

View File

@ -40,7 +40,7 @@ $query = OC_DB::prepare("
AND url LIKE ?
");
$params=array(OC_User::getUser(), urldecode($_GET["url"]));
$params=array(OC_User::getUser(), htmlspecialchars_decode($_GET["url"]));
$bookmarks = $query->execute($params);
header( "HTTP/1.1 204 No Content" );

View File

@ -39,7 +39,7 @@ $params=array(OC_User::getUser());
$CONFIG_DBTYPE = OC_Config::getValue( 'dbtype', 'sqlite' );
//Filter for tag?
$filterTag = isset($_GET['tag']) ? '%' . urldecode($_GET['tag']) . '%' : false;
$filterTag = isset($_GET['tag']) ? '%' . htmlspecialchars_decode($_GET['tag']) . '%' : false;
if($filterTag){
$sqlFilterTag = 'HAVING tags LIKE ?';
$params[] = $filterTag;

View File

@ -11,7 +11,7 @@ function getURLMetadata($url) {
$page = file_get_contents($url);
@preg_match( "/<title>(.*)<\/title>/si", $page, $match );
$metadata['title'] = htmlentities(strip_tags(@$match[1]));
$metadata['title'] = htmlspecialchars_decode(@$match[1]);
$meta = get_meta_tags($url);

View File

@ -48,7 +48,7 @@ function getMetadata() {
var url = encodeEntities($('#bookmark_add_url').val())
$.ajax({
url: 'ajax/getMeta.php',
data: 'url=' + encodeURI(url),
data: 'url=' + encodeURIComponent(url),
success: function(pageinfo){
$('#bookmark_add_url').val(pageinfo.data.url);
$('#bookmark_add_description').val(pageinfo.data.description);

View File

@ -2,7 +2,7 @@
<h2 class="bookmarks_headline"><?php echo isset($_GET["tag"]) ? 'Bookmarks with tag: ' . urldecode($_GET["tag"]) : 'All bookmarks'; ?></h2>
<div class="bookmarks_menu">
<input type="button" class="bookmarks_addBtn" value="Add Bookmark"/>&nbsp;
<a class="bookmarks_addBml" href="javascript:var url = encodeURI(location.href);window.open('<?php echo (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . OC_Helper::linkTo('bookmarks', 'addBm.php'); ?>?url='+url, 'owncloud-bookmarks');" title="Drag this to your browser bookmarks and click it, when you want to bookmark a webpage.">Add page to ownCloud</a>
<a class="bookmarks_addBml" href="javascript:var url = encodeURIComponent(location.href);window.open('<?php echo (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . OC_Helper::linkTo('bookmarks', 'addBm.php'); ?>?url='+url, 'owncloud-bookmarks');" title="Drag this to your browser bookmarks and click it, when you want to bookmark a webpage.">Add page to ownCloud</a>
</div>
<div class="bookmarks_add">
<p><label class="bookmarks_label">Address</label><input type="text" id="bookmark_add_url" class="bookmarks_input" /></p>