Skip to content

Commit

Permalink
修复特殊字符不能转义的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
weichaoduo committed Apr 27, 2020
1 parent 05f7c55 commit f1bf861
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/ctrl/issue/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ public function add($params = [])
}

$info = [];
$info['summary'] = $params['summary'];
$info['summary'] = htmlspecialchars($params['summary']);
$info['creator'] = $uid;
$info['reporter'] = $uid;
$info['created'] = time();
Expand Down Expand Up @@ -1409,6 +1409,11 @@ private function getAddFormInfo(&$params = [])
return $info;
}

/**
* @param array $params
* @return array
* @throws \Exception
*/
private function getUpdateFormInfo($params = [])
{
$info = [];
Expand Down
5 changes: 5 additions & 0 deletions event_test.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php

echo " ?\"ddd\"><><>\n";
echo htmlspecialchars(" ?\"ddd\"><><>");
die;

require './app/globals.php';

use Symfony\Contracts\EventDispatcher\Event;
Expand Down

0 comments on commit f1bf861

Please sign in to comment.