Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 11 Apr 2017, 06:04
idisforum idisforum is offline
 
Join Date: Feb 2017
Modify vBulletin php source code

I have some multi-byte character problems with php5

e.g) first multi-byte character is disappeared when uploading file. -> this is php5 basename() problem

so I go to /core/includes/class_upload.php

and write

function getbasename($path)
{
code for correct basename with multi-byte
..
..
}

and change

$this->upload['filename'] = basename($upload);
to
$this->upload['filename'] = getbasename($upload);

but when I watching packet, there is no change..

so I test
$this->upload['filename'] = basename('/var/www/test.txt');

but result is equal to original source code. ($this->upload['filename'] = basename($upload))

I have to do something for working vbulletin with modified source code
or
uploading attachment source is not in the /core/includes/class_upload.php?

p.s
I want to also modify download attachment source.
this source is in the /core/includes/functions_file.php?

Last edited by idisforum; 11 Apr 2017 at 06:22.
Reply With Quote
  #2  
Old 13 Apr 2017, 16:23
noypiscripter's Avatar
noypiscripter noypiscripter is offline
 
Join Date: Aug 2013
You need to set the locale first before calling basename(). Try this PHP fiddle:

http://phpfiddle.org/lite/code/f0ga-ynx3

I use Japanese characters as sample.
__________________
Glenn Vergara, an ex-vB Developer, now a vB Mod Developer

GIPHY for vB5 | AutoLinker | Video Attachments Player | New Registered Users Module | Clear System Cache Cron | DragNDrop Upload | Topic AJAX AutoUpdate | Force Read Topic
Reply With Quote
Reply


Tags
source


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 13:31.

Layout Options | Width: Wide Color: