Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Image upload: renaming issue
#2
clean_img_name removes @ and then urlencodes the string.

MODIFIED
PHP Code:
function clean_img_name($text)  { 
    
$text strip_tags(lowercase($text)); 
    
$code_entities_match =   array(' ?',' ','--','&quot;','!','@','#','$','%','^','&','*','(',')','+','{','}','|',':','"','<','>','?','[',']','\\',';',"'",',','/','*','+','~','`','='); 
    
$code_entities_replace = array('','-','-','','','@','','','','','','','','','','','','','','','','','','','',''); //EDITED @
    
$text str_replace($code_entities_match$code_entities_replace$text); 
    
// $text = urlencode($text); // REMOVED
    
$text str_replace('--','-',$text);
    
$text rtrim($text"-");
    return 
$text


(Also these is double encoding during the rename -n if existing. so instead of @->%40 we get %2540)

I do not know if removing the urlencode is wise, but it works. It might be wiser to convert the '%2540' back to @ after wards instead with str_replace
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply


Messages In This Thread
Image upload: renaming issue - by b3n.ji - 2014-03-05, 22:00:48
RE: Image upload: renaming issue - by shawn_a - 2014-03-06, 01:28:16
RE: Image upload: renaming issue - by b3n.ji - 2014-03-06, 02:02:00
RE: Image upload: renaming issue - by shawn_a - 2014-03-06, 02:26:13
RE: Image upload: renaming issue - by shawn_a - 2014-03-11, 03:00:57
RE: Image upload: renaming issue - by b3n.ji - 2014-03-11, 04:01:34



Users browsing this thread: 2 Guest(s)