* fix bugs.

This commit is contained in:
wangyidong
2015-01-30 15:27:51 +08:00
parent 03dae63dd0
commit 4d7feceb69
5 changed files with 15 additions and 9 deletions
+1 -1
View File
@@ -152,7 +152,7 @@ class fileModel extends model
public function getExtension($filename)
{
$extension = trim(strtolower(pathinfo($filename, PATHINFO_EXTENSION)));
if(strpos($this->config->file->dangers, $extension) !== false) return 'txt';
if(empty($extension) or strpos($this->config->file->dangers, $extension) !== false) return 'txt';
if($extension == 'php') return 'txt';
return $extension;
}
+3 -4
View File
@@ -348,12 +348,11 @@ class gitModel extends model
public function iconvComment($comment)
{
/* Get encodings. */
$encodings = str_replace(' ', '', trim($comment));
if($encodings == '') return $comment;
$encodings = explode(',', $encodings);
$encoding = str_replace(' ', '', $this->config->git->encodings);
if($encoding == '') return $comment;
/* Try convert. */
foreach($encodings as $encoding)
if($encoding != 'utf-8')
{
$result = @iconv($encoding, 'utf-8', $comment);
if($result) return $result;
+1 -1
View File
@@ -16,7 +16,7 @@
*
*/
$config->svn = new stdClass();
$config->svn->encodings = 'utf-8, gbk';
$config->svn->encodings = 'utf-8';
$config->svn->client = '';
$i = 1;
+3 -2
View File
@@ -429,10 +429,11 @@ class task extends control
*/
public function view($taskID)
{
$task = $this->task->getById($taskID, true);
$task = $this->task->getById($taskID, true);
if(!$task) die(js::error($this->lang->notFound) . js::locate('back'));
$story = $this->story->getById($task->story);
$task->storySpec = ($story != null) ? $story->spec : '';
if(!$task) die(js::error($this->lang->notFound) . js::locate('back'));
/* Update action. */
if($task->assignedTo == $this->app->user->account) $this->loadModel('action')->read('task', $taskID);
+7 -1
View File
@@ -56,4 +56,10 @@
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
</div>
<?php foreach(glob(dirname(dirname(__FILE__)) . "/ext/view/featurebar.*.html.hook.php") as $fileName) include_once $fileName; ?>
<?php
$headerHooks = glob(dirname(dirname(__FILE__)) . "/ext/view/featurebar.*.html.hook.php");
if($headerHooks)
{
foreach($headerHooks as $fileName) helper::import($fileName);
}
?>