修复basename的中文路径不认识问题

This commit is contained in:
wlx 2012-10-18 02:24:59 +00:00
parent 4e42f80e92
commit be649e1be8
1 changed files with 5 additions and 1 deletions

View File

@ -37,7 +37,7 @@
$row = pg_fetch_array($result, $ri); $row = pg_fetch_array($result, $ri);
$content.='# path: '.$row['path']."\n"; $content.='# path: '.$row['path']."\n";
$content.='mkdir -p "/home/ftp/westdc_'.$row['userid'].'/'.basename($row['path']).'"'."\n"; $content.='mkdir -p "/home/ftp/westdc_'.$row['userid'].'/'.basename($row['path']).'"'."\n";
$content.='mount --bind "'.$row['path'].'" "/home/ftp/westdc_'.$row['userid'].'/'.basename($row['path']).'"'."\n"; $content.='mount --bind "'.$row['path'].'" "/home/ftp/westdc_'.$row['userid'].'/'.preg_replace('/^.+[\\\\\\/]/', '', $row['path']).'"'."\n";
} }
$filename='./proftp-user.sh'; $filename='./proftp-user.sh';
if (!empty($content)) if (!empty($content))
@ -53,4 +53,8 @@
} }
pg_free_result($result); pg_free_result($result);
pg_close($link); pg_close($link);
function get_basename($filename)
{
return ;
}
?> ?>