<?php

use FelixOnline\Exceptions;

class ValidationController extends BaseController
{
	function GET($matches)
	{
		try {
			$code = \FelixOnline\Core\BaseManager::build('FelixOnline\Core\EmailValidation', 'email_validation')
				->filter('code = "%s"', array($matches['code']))
				->one();
		} catch (Exceptions\InternalException $e) {
			throw new NotFoundException(
				$e->getMessage(),
				$matches,
				'ValidationController',
				FrontendException::EXCEPTION_NOTFOUND,
				$e
			);
		}

		$code->setConfirmed(1)->save();

		try {
			$comments = \FelixOnline\Core\BaseManager::build('FelixOnline\Core\Comment', 'comment')
				->filter('email = "%s"', array($code->getEmail()))
				->filter('active = 1')
				->filter('spam = 0')
				->values();

			foreach($comments as $comment) {
				if ($comment->getReply()) { // if comment is replying to an internal comment 
					$comment->emailReply();
				}

				// email authors of article
				$comment->emailAuthors();
			}
		} catch (\Exception $e) {

		}

		$this->theme->appendData(array(
			'email' => $code->getEmail()
		));

		$this->theme->render('validation');
	}
}

<?php

use FelixOnline\Exceptions;

class ValidationController extends BaseController
{
	function GET($matches)
	{
		try {
			$code = \FelixOnline\Core\BaseManager::build('FelixOnline\Core\EmailValidation', 'email_validation')
				->filter('code = "%s"', array($matches['code']))
				->one();
		} catch (Exceptions\InternalException $e) {
			throw new NotFoundException(
				$e->getMessage(),
				$matches,
				'ValidationController',
				FrontendException::EXCEPTION_NOTFOUND,
				$e
			);
		}

		$code->setConfirmed(1)->save();

		try {
			$comments = \FelixOnline\Core\BaseManager::build('FelixOnline\Core\Comment', 'comment')
				->filter('email = "%s"', array($code->getEmail()))
				->filter('rejected = 0')
				->filter('spam = 0')
				->values();

			foreach($comments as $comment) {
				if ($comment->getReply()) { // if comment is replying to an internal comment 
					$comment->emailReply();
				}

				// email authors of article
				$comment->emailAuthors();
			}
		} catch (\Exception $e) {

		}

		$this->theme->appendData(array(
			'email' => $code->getEmail()
		));

		$this->theme->render('validation');
	}
}

--- 
+++ 
@@ -25,7 +25,7 @@
 		try {
 			$comments = \FelixOnline\Core\BaseManager::build('FelixOnline\Core\Comment', 'comment')
 				->filter('email = "%s"', array($code->getEmail()))
-				->filter('rejected = 0')
+				->filter('active = 1')
 				->filter('spam = 0')
 				->values();
 
Fix a SQL error in email validation
