Loading...
 
Skip to main content

tiki_objects.href field may contain URL with wrong domain for files

Status
Closed
Subject
tiki_objects.href field may contain URL with wrong domain for files
Version
3.x
Category
  • Consistency
Feature
File Gallery (elFinder or standard UI)
Resolution status
Fixed or Solved
Submitted by
micmast
Lastmod by
Ushindi Gedeon
Rating
(0)
Description

When a user uploads a file on the file gallery, the URL is saved where somebody could download the file. This URL is used by the category browser.
If the client uses a proxy (we use a SSH tunnel to connect to the wiki), the wrong URL is saved in the database (table tiki_objects).
This results in a link to the original tunnel and not the website itself.

Solution

To solve this issue we have programmed a quick fix, but this is not a definite solution.
Add the following code on several places:

Copy to clipboard
// Modified by Micmast to make sure all urls are cut if (strpos($href,"http") > -1) { $href = "tiki-download_file.php?".strstr($href,"tiki-download_file.php?"); } else { $href = $href; } // End of the modification


in file: lib/wiki/wikilib.php
in the function: wiki_rename_page(...)

before line:
Copy to clipboard
$query = "update `tiki_objects` set `itemId`=?,`name`=?,`href`=? where `itemId`=? and `type`=?";


in file: lib/objectlib.php
in function: add_object(...)

before line:
Copy to clipboard
$query = "update `tiki_objects` set `description`=?,`name`=?,`href`=? where `objectId`=?";

in function: insert_object(...)

before line:
Copy to clipboard
$query = "insert into `tiki_objects`(`type`,`itemId`,`description`,`name`,`href`,`created`,`hits`,`comments_locked`) values(?,?,?,?,?,?,?,?)";

Workaround
Importance
2
Priority
10
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
2868
Created
Tuesday 17 November, 2009 09:26:59 UTC
by micmast
LastModif
Monday 01 June, 2026 15:23:39 UTC


Show PHP error messages