* Fix bug.
This commit is contained in:
@@ -163,7 +163,7 @@ class file extends control
|
||||
if($file->extension == 'txt')
|
||||
{
|
||||
$extension = 'txt';
|
||||
if(($postion = strrpos($file->title, '.')) !== false)$extension = substr($file->title, $postion + 1);
|
||||
if(($postion = strrpos($file->title, '.')) !== false) $extension = substr($file->title, $postion + 1);
|
||||
if($extension != 'txt') $mode = 'down';
|
||||
$file->extension = $extension;
|
||||
}
|
||||
@@ -367,7 +367,7 @@ class file extends control
|
||||
$this->app->loadLang('action');
|
||||
$file = $this->file->getByID($fileID);
|
||||
$data = fixer::input('post')->get();
|
||||
$fileName = $data->fileName . '.' . $file->extension;
|
||||
$fileName = $data->fileName . '.' . $data->extension;
|
||||
$this->dao->update(TABLE_FILE)->set('title')->eq($fileName)->where('id')->eq($fileID)->exec();
|
||||
|
||||
$extension = "." . $file->extension;
|
||||
|
||||
@@ -31,12 +31,24 @@ function closeWindow()
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->file->inputFileName;?></h2>
|
||||
</div>
|
||||
<?php
|
||||
if(strrpos($file->title, '.') !== false)
|
||||
{
|
||||
/* Fix the file name exe.exe */
|
||||
$title = explode('.', $file->title);
|
||||
$extension = end($title);
|
||||
if($file->extension == 'txt' && $extension != $file->extension) $file->extension = $extension;
|
||||
array_pop($title);
|
||||
$file->title = join('.', $title);
|
||||
}
|
||||
?>
|
||||
<form class='main-form' method='post' target='hiddenwin' onsubmit='setFileName();'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::input('fileName', rtrim($file->title, '.' . $file->extension), "class='form-control' size='40' autocomplete='off'");?>
|
||||
<?php echo html::input('fileName', $file->title, "class='form-control' size='40' autocomplete='off'");?>
|
||||
<input type="hidden" name="extension" value="<?php echo $file->extension;?>"/>
|
||||
<strong class='input-group-addon'>.<?php echo $file->extension;?></strong>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user