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
- 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
before line:
in file: lib/wiki/wikilib.php
in the function: wiki_rename_page(...)Copy to clipboard$query = "update `tiki_objects` set `itemId`=?,`name`=?,`href`=? where `itemId`=? and `type`=?";
before line:
in file: lib/objectlib.php
in function: add_object(...)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+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 2868
- Created
- Tuesday 17 November, 2009 09:26:59 UTC
by micmast - LastModif
- Monday 01 June, 2026 15:23:39 UTC