Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [----- Fixes for Kusaba X URL Upload -----]
- -This was a paste detailing a bug with Jmyeom's URL upload mod (http://pastebin.com/BL2fcf9M) and newer versions of Kusaba X I'm re-uploading on request, I think the fix is tested on a few sites and works okay.-
- Originally I was making a fix for the mod insisting it has a message with an image uploaded from URL, the fix for that:
- In board.php,
- if ($post_isreply) {
- if ($imagefile_name == '' && !$is_oekaki && $post_message == '') {
- exitWithErrorPage(_gettext('An image, or message, is required for a reply.'));
- Becomes:
- if ($post_isreply) {
- if ($imagefile_name == '' && !$is_oekaki && $post_message == '' && empty($_POST['fileurl'])) {
- exitWithErrorPage(_gettext('An image, or message, is required for a reply.'));
- While playing about with that I noticed I was able to post with no file or message, threads and replies, wether or not my new fix was included.
- The "A file is required for a new thread. If embedding is allowed, either a file or embed ID is required." error wasn't chucking right, either was the relevant error in threads.
- My fix for that:
- In board.php,
- if ($imagefile_name == '' && !$is_oekaki && ((!isset($_POST['nofile'])&&$board_class->board['enablenofile']==1) || $board_class->board['enablenofile']==0) && ($board_class->board['type'] == 0 || $board_class->board['type'] == 2 || $board_class->board['type'] == 3) && !isset($_POST['fileurl']) && !empty($_POST['fileurl'])) {
- if (!isset($_POST['embed']) && $board_class->board['uploadtype'] != 1) {
- exitWithErrorPage(_gettext('A file is required for a new thread. If embedding is allowed, either a file or embed ID is required.'));
- }
- Must have
- && !isset($_POST['fileurl'])
- Removed to make it
- if ($imagefile_name == '' && !$is_oekaki && ((!isset($_POST['nofile'])&&$board_class->board['enablenofile']==1) || $board_class->board['enablenofile']==0) && ($board_class->board['type'] == 0 || $board_class->board['type'] == 2 || $board_class->board['type'] == 3) && empty($_POST['fileurl']) ) {
- if (!isset($_POST['embed']) && $board_class->board['uploadtype'] != 1) {
- exitWithErrorPage(_gettext('A file is required for a new thread. If embedding is allowed, either a file or embed ID is required.'));
- }
- My initial fix was removing
- && !isset($_POST['fileurl']) && !empty($_POST['fileurl'])
- Though that prevented new threads with a URL image, so i returned
- !empty($_POST['fileurl'])
- And that seems to be it.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement