Merge branch 'fix/Some_fixes_on_comments' into 'master'

Some fixes on comments

Fix #205 

See merge request !161
This commit is contained in:
Antonin 2016-12-06 15:34:10 +01:00
commit 14451ade7a
2 changed files with 6 additions and 1 deletions

View File

@ -34,7 +34,11 @@ class NotificationService {
$_SESSION['mail_sent'] = [];
}
if ($poll->receiveNewVotes) {
$isVoteAndCanSendIt = ($type == self::UPDATE_VOTE || $type == self::ADD_VOTE) && $poll->receiveNewVotes;
$isCommentAndCanSendIt = $type == self::ADD_COMMENT && $poll->receiveNewComments;
$isOtherType = $type != self::UPDATE_VOTE && $type != self::ADD_VOTE && $type != self::ADD_COMMENT;
if ($isVoteAndCanSendIt || $isCommentAndCanSendIt || $isOtherType) {
if (self::isParticipation($type)) {
$translationString = 'Poll\'s participation: %s';

View File

@ -28,6 +28,7 @@ class Utils {
$dirname = dirname($_SERVER['SCRIPT_NAME']);
$dirname = $dirname === '\\' ? '/' : $dirname . '/';
$dirname = str_replace('/admin', '', $dirname);
$dirname = str_replace('/action', '', $dirname);
$server_name = (defined('APP_URL') ? APP_URL : $_SERVER['SERVER_NAME']) . $port . $dirname;
return $scheme . '://' . preg_replace('#//+#', '/', $server_name);