euromark 12 years ago
parent
commit
9b47f9811b
34 changed files with 146 additions and 64 deletions
  1. 3 1
      Console/Command/CodeShell.php
  2. 2 0
      Controller/Component/CalendarComponent.php
  3. 15 8
      Lib/DiffLib.php
  4. 1 0
      Lib/GeocodeLib.php
  5. 2 2
      Lib/HttpSocketLib.php
  6. 1 0
      Lib/IcalLib.php
  7. 24 3
      Lib/ImapLib.php
  8. 3 3
      Lib/InlineCssLib.php
  9. 11 10
      Lib/Utility/TextAnalysisLib.php
  10. 4 3
      Lib/Utility/TextLib.php
  11. 1 0
      Model/Behavior/DecimalInputBehavior.php
  12. 3 3
      Model/Behavior/LogableBehavior.php
  13. 1 0
      Model/Behavior/NumberFormatBehavior.php
  14. 4 4
      Model/Datasource/ImapSource.php
  15. 2 0
      Test/Case/Controller/Component/AutoLoginComponentTest.php
  16. 2 0
      Test/Case/Controller/Component/CommonComponentTest.php
  17. 1 0
      Test/Case/Lib/Utility/ChmodLibTest.php
  18. 1 0
      Test/Case/Model/Behavior/MasterPasswordBehaviorTest.php
  19. 23 0
      Test/Case/Model/Behavior/RevisionBehaviorTest.php
  20. 1 0
      Test/Case/Model/ContactFormTest.php
  21. 1 0
      Test/Fixture/LogableBookFixture.php
  22. 1 0
      Test/Fixture/LogableCommentFixture.php
  23. 1 0
      Test/Fixture/LogableUserFixture.php
  24. 1 0
      Test/Fixture/RevisionArticleFixture.php
  25. 1 0
      Test/Fixture/RevisionArticlesRevFixture.php
  26. 1 0
      Test/Fixture/RevisionCommentFixture.php
  27. 1 0
      Test/Fixture/RevisionCommentsRevFixture.php
  28. 1 0
      Test/Fixture/RevisionPostFixture.php
  29. 1 0
      Test/Fixture/RevisionPostsRevFixture.php
  30. 1 0
      Test/Fixture/RevisionUserFixture.php
  31. 3 1
      View/Helper/CommonHelper.php
  32. 14 14
      View/Helper/PhpThumbHelper.php
  33. 12 10
      View/Helper/TextExtHelper.php
  34. 2 2
      View/Helper/TypographyHelper.php

+ 3 - 1
Console/Command/CodeShell.php

@@ -92,7 +92,8 @@ class CodeShell extends AppShell {
 		$pos = 1;
 		$pos = 1;
 
 
 		if (!empty($fileContent[1]) && $fileContent[1] === '/**') {
 		if (!empty($fileContent[1]) && $fileContent[1] === '/**') {
-			for ($i = $pos; $i < count($fileContent) - 1; $i++) {
+			$count = count($fileContent);
+			for ($i = $pos; $i < $count - 1; $i++) {
 				if (strpos($fileContent[$i], '*/') !== false) {
 				if (strpos($fileContent[$i], '*/') !== false) {
 					if (strpos($fileContent[$i + 1], 'class ') !== 0) {
 					if (strpos($fileContent[$i + 1], 'class ') !== 0) {
 						$pos = $i + 1;
 						$pos = $i + 1;
@@ -175,6 +176,7 @@ class CodeShell extends AppShell {
 	 * Make sure all files are properly encoded (ü instead of &uuml; etc)
 	 * Make sure all files are properly encoded (ü instead of &uuml; etc)
 	 * FIXME: non-utf8 files to utf8 files error on windows!
 	 * FIXME: non-utf8 files to utf8 files error on windows!
 	 *
 	 *
+	 * @return void
 	 */
 	 */
 	public function utf8() {
 	public function utf8() {
 		$this->_paths = array(APP . 'View' . DS);
 		$this->_paths = array(APP . 'View' . DS);

+ 2 - 0
Controller/Component/CalendarComponent.php

@@ -24,7 +24,9 @@ class CalendarComponent extends Component {
 	);
 	);
 
 
 	public $year = null;
 	public $year = null;
+
 	public $month = null;
 	public $month = null;
+
 	public $day = null;
 	public $day = null;
 
 
 	/**
 	/**

+ 15 - 8
Lib/DiffLib.php

@@ -46,7 +46,7 @@ class DiffLib {
 	 *
 	 *
 	 * @var boolean
 	 * @var boolean
 	 */
 	 */
-	public $character_diff = true;
+	public $characterDiff = true;
 
 
 	/**
 	/**
 	 * If the params are strings on what characters do you want to explode the string?
 	 * If the params are strings on what characters do you want to explode the string?
@@ -54,14 +54,14 @@ class DiffLib {
 	 *
 	 *
 	 * @var mixed
 	 * @var mixed
 	 */
 	 */
-	public $explode_on = "\r\n";
+	public $explodeOn = "\r\n";
 
 
 	/**
 	/**
 	 * How many context lines do you want to see around the changed line?
 	 * How many context lines do you want to see around the changed line?
 	 *
 	 *
 	 * @var integer
 	 * @var integer
 	 */
 	 */
-	public $context_lines = 4;
+	public $contextLines = 4;
 
 
 	/**
 	/**
 	 * DiffLib::__construct()
 	 * DiffLib::__construct()
@@ -130,7 +130,7 @@ class DiffLib {
 		}
 		}
 		$rendererClassName = 'Horde_Text_Diff_Renderer_' . ucfirst($this->renderer);
 		$rendererClassName = 'Horde_Text_Diff_Renderer_' . ucfirst($this->renderer);
 
 
-		$renderer = new $rendererClassName(array('context_lines' => $this->context_lines, 'character_diff' => $this->character_diff));
+		$renderer = new $rendererClassName(array('context_lines' => $this->contextLines, 'character_diff' => $this->characterDiff));
 		$diff = new Horde_Text_Diff($this->engine, array($original, $changed));
 		$diff = new Horde_Text_Diff($this->engine, array($original, $changed));
 
 
 		$string = $renderer->render($diff);
 		$string = $renderer->render($diff);
@@ -150,7 +150,7 @@ class DiffLib {
 
 
 		$diff = new Horde_Text_Diff('string', array($string, $options['mode']));
 		$diff = new Horde_Text_Diff('string', array($string, $options['mode']));
 		$rendererClassName = 'Horde_Text_Diff_Renderer_' . ucfirst($this->renderer);
 		$rendererClassName = 'Horde_Text_Diff_Renderer_' . ucfirst($this->renderer);
-		$renderer = new $rendererClassName(array('context_lines' => $this->context_lines, 'character_diff' => $this->character_diff));
+		$renderer = new $rendererClassName(array('context_lines' => $this->contextLines, 'character_diff' => $this->characterDiff));
 		$string = $renderer->render($diff);
 		$string = $renderer->render($diff);
 		return $string;
 		return $string;
 	}
 	}
@@ -162,13 +162,13 @@ class DiffLib {
 	 * @return array
 	 * @return array
 	 */
 	 */
 	protected function _explode($text) {
 	protected function _explode($text) {
-		if (is_array($this->explode_on)) {
-			foreach ($this->explode_on as $explodeOn) {
+		if (is_array($this->explodeOn)) {
+			foreach ($this->explodeOn as $explodeOn) {
 				$text = explode($explodeOn, $text);
 				$text = explode($explodeOn, $text);
 			}
 			}
 			return $text;
 			return $text;
 		}
 		}
-		return explode($this->explode_on, $text);
+		return explode($this->explodeOn, $text);
 	}
 	}
 
 
 	/**
 	/**
@@ -298,16 +298,23 @@ class DiffLib {
 /*** other files **/
 /*** other files **/
 
 
 class Changes {
 class Changes {
+
 	public $line = 0;
 	public $line = 0;
+
 	public $length = 0;
 	public $length = 0;
+
 	public $symbol;
 	public $symbol;
+
 	public $oldline = array(); // only for code removed
 	public $oldline = array(); // only for code removed
 }
 }
 
 
 // This object is created for every line of text in the file.
 // This object is created for every line of text in the file.
 // It was either this, or some funk string changes
 // It was either this, or some funk string changes
 class Line {
 class Line {
+
 	public $text = '';
 	public $text = '';
+
 	public $symbol = '';
 	public $symbol = '';
+
 	public $changed = false;
 	public $changed = false;
 }
 }

+ 1 - 0
Lib/GeocodeLib.php

@@ -88,6 +88,7 @@ class GeocodeLib {
 	);
 	);
 
 
 	protected $error = array();
 	protected $error = array();
+
 	protected $result = null;
 	protected $result = null;
 
 
 	protected $statusCodes = array(
 	protected $statusCodes = array(

+ 2 - 2
Lib/HttpSocketLib.php

@@ -165,10 +165,10 @@ class HttpSocketLib {
 			}
 			}
 			$context = stream_context_create($opts);
 			$context = stream_context_create($opts);
 			$response = file_get_contents($url, false, $context);
 			$response = file_get_contents($url, false, $context);
-			if (!isset($http_response_header)) {
+			if (!isset($httpResponseHeader)) {
 				return false;
 				return false;
 			}
 			}
-			preg_match('/^HTTP.*\s([0-9]{3})/', $http_response_header[0], $matches);
+			preg_match('/^HTTP.*\s([0-9]{3})/', $httpResponseHeader[0], $matches);
 			$statusCode = (int)$matches[1];
 			$statusCode = (int)$matches[1];
 			if (!in_array($statusCode, $allowedCodes)) {
 			if (!in_array($statusCode, $allowedCodes)) {
 				return false;
 				return false;

+ 1 - 0
Lib/IcalLib.php

@@ -18,6 +18,7 @@ App::uses('TimeLib', 'Tools.Utility');
 class IcalLib {
 class IcalLib {
 
 
 	public $Ical;
 	public $Ical;
+
 	public $Time;
 	public $Time;
 
 
 	public function __construct() {
 	public function __construct() {

+ 24 - 3
Lib/ImapLib.php

@@ -54,6 +54,7 @@ class ImapLib {
 	);
 	);
 
 
 	public $currentSettings = array();
 	public $currentSettings = array();
+
 	public $currentRef = '';
 	public $currentRef = '';
 
 
 	public function __construct() {
 	public function __construct() {
@@ -455,7 +456,7 @@ class ImapLib {
 
 
 			$this->mbox .= '/user="' . $this->user . '"';
 			$this->mbox .= '/user="' . $this->user . '"';
 			$this->mbox .= '}';
 			$this->mbox .= '}';
-			$this->mbox .= $this->default_mailbox;
+			$this->mbox .= $this->defaultMailbox;
 
 
 			if ($mailbox) {
 			if ($mailbox) {
 				$this->mbox .= '.' . $mailbox;
 				$this->mbox .= '.' . $mailbox;
@@ -534,23 +535,39 @@ class ImapMessageInfoLib {
 	const BS = "\\";
 	const BS = "\\";
 
 
 	public $ImapFolder;
 	public $ImapFolder;
+
 	public $ImapMessage;
 	public $ImapMessage;
 
 
 	public $subject;
 	public $subject;
+
 	public $from;
 	public $from;
+
 	public $to;
 	public $to;
+
 	public $date;
 	public $date;
-	public $message_id;
+
+	public $messageId;
+
 	public $references;
 	public $references;
-	public $in_reply_to;
+
+	public $inReplyTo;
+
 	public $size;
 	public $size;
+
 	public $uid;
 	public $uid;
+
 	public $msgno;
 	public $msgno;
+
 	public $recent;
 	public $recent;
+
 	public $flagged;
 	public $flagged;
+
 	public $answered;
 	public $answered;
+
 	public $deleted;
 	public $deleted;
+
 	public $seen;
 	public $seen;
+
 	public $draft;
 	public $draft;
 
 
 	public function __construct($ImapFolder, $data) {
 	public function __construct($ImapFolder, $data) {
@@ -635,7 +652,9 @@ class ImapMessageInfoLib {
 class ImapMessageLib {
 class ImapMessageLib {
 
 
 	public $ImapFolder;
 	public $ImapFolder;
+
 	public $MessageInfo;
 	public $MessageInfo;
+
 	public $uid;
 	public $uid;
 
 
 	public function __construct($ImapFolder, $uid, $ImapMessageInfo = null) {
 	public function __construct($ImapFolder, $uid, $ImapMessageInfo = null) {
@@ -675,6 +694,7 @@ class ImapMessageLib {
 class ImapMessagesListLib {
 class ImapMessagesListLib {
 
 
 	public $ImapFolder;
 	public $ImapFolder;
+
 	public $messageUIDs = array();
 	public $messageUIDs = array();
 
 
 	public function __construct($ImapFolder, $messageUIDs) {
 	public function __construct($ImapFolder, $messageUIDs) {
@@ -739,6 +759,7 @@ class ImapFolderLib {
 	const S_UNSEEN = 'UNSEEN';
 	const S_UNSEEN = 'UNSEEN';
 
 
 	public $Imap;
 	public $Imap;
+
 	public $currentRef = '';
 	public $currentRef = '';
 
 
 	public function __construct($Imap) {
 	public function __construct($Imap) {

+ 3 - 3
Lib/InlineCssLib.php

@@ -151,7 +151,7 @@ class InlineCssLib {
 
 
 				// find the css file and load contents
 				// find the css file and load contents
 				if ($link->hasAttribute('media')) {
 				if ($link->hasAttribute('media')) {
-					foreach ($this->media_types as $cssLinkMedia) {
+					foreach ($this->mediaTypes as $cssLinkMedia) {
 						if (strstr($link->getAttribute('media'), $cssLinkMedia)) {
 						if (strstr($link->getAttribute('media'), $cssLinkMedia)) {
 							$css .= $this->_findAndLoadCssFile($link->getAttribute('href')) . "\n\n";
 							$css .= $this->_findAndLoadCssFile($link->getAttribute('href')) . "\n\n";
 							$removeDoms[] = $link;
 							$removeDoms[] = $link;
@@ -170,7 +170,7 @@ class InlineCssLib {
 		// Style
 		// Style
 		foreach ($styles as $style) {
 		foreach ($styles as $style) {
 			if ($style->hasAttribute('media')) {
 			if ($style->hasAttribute('media')) {
-				foreach ($this->media_types as $cssLinkMedia) {
+				foreach ($this->mediaTypes as $cssLinkMedia) {
 					if (strstr($style->getAttribute('media'), $cssLinkMedia)) {
 					if (strstr($style->getAttribute('media'), $cssLinkMedia)) {
 						$css .= $this->_parseInlineCssAndLoadImports($style->nodeValue);
 						$css .= $this->_parseInlineCssAndLoadImports($style->nodeValue);
 						$removeDoms[] = $style;
 						$removeDoms[] = $style;
@@ -276,7 +276,7 @@ class InlineCssLib {
 
 
 			foreach ($matches[1] as $url) {
 			foreach ($matches[1] as $url) {
 				if (preg_match("/^http/i", $url)) {
 				if (preg_match("/^http/i", $url)) {
-					if ($this->import_external_css) {
+					if ($this->importExternalCss) {
 						$css .= file_get_contents($url);
 						$css .= file_get_contents($url);
 					}
 					}
 				} else {
 				} else {

+ 11 - 10
Lib/Utility/TextAnalysisLib.php

@@ -8,6 +8,7 @@ App::uses('TextLib', 'Tools.Utility');
 class TextAnalysisLib extends TextLib {
 class TextAnalysisLib extends TextLib {
 
 
 	protected $text, $lenght, $char, $letter, $space, $word, $r_word, $sen, $r_sen, $para,
 	protected $text, $lenght, $char, $letter, $space, $word, $r_word, $sen, $r_sen, $para,
+
 		$r_para, $beautified;
 		$r_para, $beautified;
 
 
 	public function __construct($text = null) {
 	public function __construct($text = null) {
@@ -217,12 +218,12 @@ class TextAnalysisLib extends TextLib {
 
 
 	//TODO: improve it to work with case insensitivity and utf8 chars like é or î
 	//TODO: improve it to work with case insensitivity and utf8 chars like é or î
 	public function getWord($parse = false) {
 	public function getWord($parse = false) {
-		if (!$this->word && !$this->r_word) {
+		if (!$this->word && !$this->rWord) {
 			@preg_match_all("/[A-Za-zäöüÄÖÜß\-'\\\"]+/", $this->text, $m);
 			@preg_match_all("/[A-Za-zäöüÄÖÜß\-'\\\"]+/", $this->text, $m);
 			$this->word = count($m[0]);
 			$this->word = count($m[0]);
-			$this->r_word = $m[0];
+			$this->rWord = $m[0];
 		}
 		}
-		return $parse ? $this->r_word : $this->word;
+		return $parse ? $this->rWord : $this->word;
 	}
 	}
 
 
 	/**
 	/**
@@ -230,7 +231,7 @@ class TextAnalysisLib extends TextLib {
 	 * - min_char, max_char, case_sensititive, sort ('asc', 'desc', 'length', 'alpha', false), limit...
 	 * - min_char, max_char, case_sensititive, sort ('asc', 'desc', 'length', 'alpha', false), limit...
 	 */
 	 */
 	public function wordCount($options = array()) {
 	public function wordCount($options = array()) {
-		if (true || !$this->rr_word) {
+		if (true || !$this->rrWord) {
 			$text = str_replace(array(NL, CR, PHP_EOL, TB), ' ', $this->text);
 			$text = str_replace(array(NL, CR, PHP_EOL, TB), ' ', $this->text);
 			$res = array();
 			$res = array();
 			$search = array('*', '+', '~', ',', '.', ';', ':', '#', '', '(', ')', '{', '}', '[', ']', '$', '%', '“', '”', '—', '"', '‘', '’', '!', '?', '<', '>', '=', '/');
 			$search = array('*', '+', '~', ',', '.', ';', ':', '#', '', '(', ')', '{', '}', '[', ']', '$', '%', '“', '”', '—', '"', '‘', '’', '!', '?', '<', '>', '=', '/');
@@ -280,22 +281,22 @@ class TextAnalysisLib extends TextLib {
 	}
 	}
 
 
 	public function getSentence($parse = false) {
 	public function getSentence($parse = false) {
-		if (!$this->sen && !$this->r_sen) {
+		if (!$this->sen && !$this->rSen) {
 			@preg_match_all("/[^:|;|\!|\.]+(:|;|\!|\.| )+/", $this->text, $m);
 			@preg_match_all("/[^:|;|\!|\.]+(:|;|\!|\.| )+/", $this->text, $m);
 			$this->sen = count($m[0]);
 			$this->sen = count($m[0]);
-			foreach ($m[0] as $s) $this->r_sen[] = strtr(trim($s), array("\n" => '', "\r" => ''));
+			foreach ($m[0] as $s) $this->rSen[] = strtr(trim($s), array("\n" => '', "\r" => ''));
 		}
 		}
-		return $parse ? $this->r_sen : $this->sen;
+		return $parse ? $this->rSen : $this->sen;
 	}
 	}
 
 
 	public function getParagraph($parse = false) {
 	public function getParagraph($parse = false) {
-		if (!$this->para && !$this->r_para) {
+		if (!$this->para && !$this->rPara) {
 			@preg_match_all("/[^\n]+?(:|;|\!|\.| )+\n/s", strtr($this->text, array("\r" =>
 			@preg_match_all("/[^\n]+?(:|;|\!|\.| )+\n/s", strtr($this->text, array("\r" =>
 				'')) . "\n", $m);
 				'')) . "\n", $m);
 			$this->para = count($m[0]);
 			$this->para = count($m[0]);
-			foreach ($m[0] as $p) $this->r_para[] = trim($p);
+			foreach ($m[0] as $p) $this->rPara[] = trim($p);
 		}
 		}
-		return $parse ? $this->r_para : $this->para;
+		return $parse ? $this->rPara : $this->para;
 	}
 	}
 
 
 	public function beautify($wordwrap = false) {
 	public function beautify($wordwrap = false) {

+ 4 - 3
Lib/Utility/TextLib.php

@@ -8,7 +8,8 @@ App::uses('String', 'Utility');
  */
  */
 class TextLib extends String {
 class TextLib extends String {
 
 
-	protected $text, $lenght, $char, $letter, $space, $word, $r_word, $sen, $r_sen, $para,
+	protected $text, $length, $char, $letter, $space, $word, $r_word, $sen, $r_sen, $para,
+
 		$r_para, $beautified;
 		$r_para, $beautified;
 
 
 	public function __construct($text = null) {
 	public function __construct($text = null) {
@@ -198,7 +199,7 @@ class TextLib extends String {
 	 * @return array
 	 * @return array
 	 */
 	 */
 	public function words($options = array()) {
 	public function words($options = array()) {
-		if (true || !$this->xr_word) {
+		if (true || !$this->xrWord) {
 			$text = str_replace(array(PHP_EOL, NL, TB), ' ', $this->text);
 			$text = str_replace(array(PHP_EOL, NL, TB), ' ', $this->text);
 
 
 			$pieces = explode(' ', $text);
 			$pieces = explode(' ', $text);
@@ -221,7 +222,7 @@ class TextLib extends String {
 				}
 				}
 			}
 			}
 			$pieces = array_unique($pieces);
 			$pieces = array_unique($pieces);
-			//$this->xr_word = $pieces;
+			//$this->xrWord = $pieces;
 		}
 		}
 		return $pieces;
 		return $pieces;
 	}
 	}

+ 1 - 0
Model/Behavior/DecimalInputBehavior.php

@@ -53,6 +53,7 @@ class DecimalInputBehavior extends ModelBehavior {
 	);
 	);
 
 
 	public $delimiterBaseFormat = array();
 	public $delimiterBaseFormat = array();
+
 	public $delimiterFromFormat = array();
 	public $delimiterFromFormat = array();
 
 
 	/**
 	/**

+ 3 - 3
Model/Behavior/LogableBehavior.php

@@ -536,9 +536,9 @@ class LogableBehavior extends ModelBehavior {
 			unset($Model->logableAction);
 			unset($Model->logableAction);
 		}
 		}
 
 
-		if ($this->Log->hasField('version_id') && isset($Model->version_id)) {
-			$logData[$this->Log->alias]['version_id'] = $Model->version_id;
-			unset($Model->version_id);
+		if ($this->Log->hasField('version_id') && isset($Model->versionId)) {
+			$logData[$this->Log->alias]['version_id'] = $Model->versionId;
+			unset($Model->versionId);
 		}
 		}
 
 
 		if ($this->Log->hasField('ip') && $this->userIP) {
 		if ($this->Log->hasField('ip') && $this->userIP) {

+ 1 - 0
Model/Behavior/NumberFormatBehavior.php

@@ -53,6 +53,7 @@ class NumberFormatBehavior extends ModelBehavior {
 	);
 	);
 
 
 	public $delimiterBaseFormat = array();
 	public $delimiterBaseFormat = array();
+
 	public $delimiterFromFormat = array();
 	public $delimiterFromFormat = array();
 
 
 	/**
 	/**

+ 4 - 4
Model/Datasource/ImapSource.php

@@ -967,7 +967,7 @@ class ImapSource extends DataSource {
 
 
 		$return[$Model->alias] = array(
 		$return[$Model->alias] = array(
 			'id' => $this->_toId($uid),
 			'id' => $this->_toId($uid),
-			'message_id' => $Mail->message_id,
+			'message_id' => $Mail->messageId,
 			'email_number' => $Mail->Msgno,
 			'email_number' => $Mail->Msgno,
 
 
 			'from' => $this->_personId($Mail, 'from', 'address'),
 			'from' => $this->_personId($Mail, 'from', 'address'),
@@ -992,9 +992,9 @@ class ImapSource extends DataSource {
 			'deleted' => @$Mail->Deleted === 'D' ? 1 : 0,
 			'deleted' => @$Mail->Deleted === 'D' ? 1 : 0,
 
 
 			'thread_count' => $this->_getThreadCount($Mail),
 			'thread_count' => $this->_getThreadCount($Mail),
-			'in_reply_to' => @$Mail->in_reply_to,
+			'in_reply_to' => @$Mail->inReplyTo,
 			'reference' => @$Mail->references,
 			'reference' => @$Mail->references,
-			'new' => (int)@$Mail->in_reply_to,
+			'new' => (int)@$Mail->inReplyTo,
 			'created' => date('Y-m-d H:i:s', strtotime($Mail->date)),
 			'created' => date('Y-m-d H:i:s', strtotime($Mail->date)),
 			);
 			);
 		$return['Recipient'] = $this->_personId($Mail, 'to');
 		$return['Recipient'] = $this->_personId($Mail, 'to');
@@ -1279,7 +1279,7 @@ class ImapSource extends DataSource {
 	 * @return integer the number of mails in the thred
 	 * @return integer the number of mails in the thred
 	 */
 	 */
 	protected function _getThreadCount($Mail) {
 	protected function _getThreadCount($Mail) {
-		if (isset($Mail->reference) || isset($Mail->in_reply_to)) {
+		if (isset($Mail->reference) || isset($Mail->inReplyTo)) {
 			return '?';
 			return '?';
 		}
 		}
 		return 0;
 		return 0;

+ 2 - 0
Test/Case/Controller/Component/AutoLoginComponentTest.php

@@ -108,12 +108,14 @@ class AutoLoginTestController extends Controller {
 	 * @var array
 	 * @var array
 	 */
 	 */
 	public $components = array('Tools.AutoLogin');
 	public $components = array('Tools.AutoLogin');
+
 	/**
 	/**
 	 * Failed property
 	 * Failed property
 	 *
 	 *
 	 * @var boolean
 	 * @var boolean
 	 */
 	 */
 	public $failed = false;
 	public $failed = false;
+
 	/**
 	/**
 	 * Used for keeping track of headers in test
 	 * Used for keeping track of headers in test
 	 *
 	 *

+ 2 - 0
Test/Case/Controller/Component/CommonComponentTest.php

@@ -344,7 +344,9 @@ class CommonComponentTestController extends Controller {
 class TestComponent extends Component {
 class TestComponent extends Component {
 
 
 	public $Controller;
 	public $Controller;
+
 	public $isInit = false;
 	public $isInit = false;
+
 	public $isStartup = false;
 	public $isStartup = false;
 
 
 	public function initialize(Controller $Controller) {
 	public function initialize(Controller $Controller) {

+ 1 - 0
Test/Case/Lib/Utility/ChmodLibTest.php

@@ -6,6 +6,7 @@ App::uses('ChmodLib', 'Tools.Utility');
  * testing
  * testing
  */
  */
 class ChmodLibTest extends CakeTestCase {
 class ChmodLibTest extends CakeTestCase {
+
 	public $Chmod = null;
 	public $Chmod = null;
 
 
 	public function setUp() {
 	public function setUp() {

+ 1 - 0
Test/Case/Model/Behavior/MasterPasswordBehaviorTest.php

@@ -165,6 +165,7 @@ class MasterPasswordBehaviorTest extends MyCakeTestCase {
 }
 }
 
 
 class MasterPasswordTestModel extends CakeTestModel {
 class MasterPasswordTestModel extends CakeTestModel {
+
 	public $useTable = false;
 	public $useTable = false;
 
 
 }
 }

+ 23 - 0
Test/Case/Model/Behavior/RevisionBehaviorTest.php

@@ -1348,12 +1348,16 @@ class RevisionBehaviorTest extends CakeTestCase {
 }
 }
 
 
 class RevisionTestModel extends CakeTestModel {
 class RevisionTestModel extends CakeTestModel {
+
 	public $logableAction;
 	public $logableAction;
 }
 }
 
 
 class RevisionPost extends RevisionTestModel {
 class RevisionPost extends RevisionTestModel {
+
 	public $name = 'RevisionPost';
 	public $name = 'RevisionPost';
+
 	public $alias = 'Post';
 	public $alias = 'Post';
+
 	public $actsAs = array('Revision' => array('limit' => 5));
 	public $actsAs = array('Revision' => array('limit' => 5));
 
 
 	public function beforeUndelete() {
 	public function beforeUndelete() {
@@ -1368,8 +1372,11 @@ class RevisionPost extends RevisionTestModel {
 }
 }
 
 
 class RevisionArticle extends RevisionTestModel {
 class RevisionArticle extends RevisionTestModel {
+
 	public $name = 'RevisionArticle';
 	public $name = 'RevisionArticle';
+
 	public $alias = 'Article';
 	public $alias = 'Article';
+
 	public $actsAs = array('Tree', 'Revision' => array('ignore' => array('title')));
 	public $actsAs = array('Tree', 'Revision' => array('ignore' => array('title')));
 
 
 	/**
 	/**
@@ -1389,14 +1396,20 @@ class RevisionArticle extends RevisionTestModel {
 }
 }
 
 
 class RevisionUser extends RevisionTestModel {
 class RevisionUser extends RevisionTestModel {
+
 	public $name = 'RevisionUser';
 	public $name = 'RevisionUser';
+
 	public $alias = 'User';
 	public $alias = 'User';
+
 	public $actsAs = array('Revision');
 	public $actsAs = array('Revision');
 }
 }
 
 
 class RevisionComment extends RevisionTestModel {
 class RevisionComment extends RevisionTestModel {
+
 	public $name = 'RevisionComment';
 	public $name = 'RevisionComment';
+
 	public $alias = 'Comment';
 	public $alias = 'Comment';
+
 	public $actsAs = array('Containable', 'Revision');
 	public $actsAs = array('Containable', 'Revision');
 
 
 	public $hasMany = array('Vote' => array(
 	public $hasMany = array('Vote' => array(
@@ -1406,20 +1419,30 @@ class RevisionComment extends RevisionTestModel {
 }
 }
 
 
 class RevisionVote extends RevisionTestModel {
 class RevisionVote extends RevisionTestModel {
+
 	public $name = 'RevisionVote';
 	public $name = 'RevisionVote';
+
 	public $alias = 'Vote';
 	public $alias = 'Vote';
+
 	public $actsAs = array('Revision');
 	public $actsAs = array('Revision');
 }
 }
 
 
 class RevisionTag extends RevisionTestModel {
 class RevisionTag extends RevisionTestModel {
+
 	public $name = 'RevisionTag';
 	public $name = 'RevisionTag';
+
 	public $alias = 'Tag';
 	public $alias = 'Tag';
+
 	public $actsAs = array('Revision');
 	public $actsAs = array('Revision');
+
 	public $hasAndBelongsToMany = array('Comment' => array('className' => 'RevisionComment'));
 	public $hasAndBelongsToMany = array('Comment' => array('className' => 'RevisionComment'));
 }
 }
 
 
 class CommentsTag extends RevisionTestModel {
 class CommentsTag extends RevisionTestModel {
+
 	public $name = 'CommentsTag';
 	public $name = 'CommentsTag';
+
 	public $useTable = 'revision_comments_revision_tags';
 	public $useTable = 'revision_comments_revision_tags';
+
 	public $actsAs = array('Revision');
 	public $actsAs = array('Revision');
 }
 }

+ 1 - 0
Test/Case/Model/ContactFormTest.php

@@ -3,6 +3,7 @@
 //App::uses('ContactForm', 'Tools.Model');
 //App::uses('ContactForm', 'Tools.Model');
 
 
 class ContactFormTest extends CakeTestCase {
 class ContactFormTest extends CakeTestCase {
+
 	public $ContactForm = null;
 	public $ContactForm = null;
 	//public $fixtures = array('app.code_key');
 	//public $fixtures = array('app.code_key');
 
 

+ 1 - 0
Test/Fixture/LogableBookFixture.php

@@ -6,6 +6,7 @@ class LogableBookFixture extends CakeTestFixture {
 		'title' => array('type' => 'string', 'length' => 255, 'null' => false),
 		'title' => array('type' => 'string', 'length' => 255, 'null' => false),
 		'weight' => array('type' => 'integer', 'null' => false)
 		'weight' => array('type' => 'integer', 'null' => false)
 	);
 	);
+
 	public $records = array(
 	public $records = array(
 		array('id' => 3, 'title' => 'Sixth Book', 'weight' => 6 ),
 		array('id' => 3, 'title' => 'Sixth Book', 'weight' => 6 ),
 		array('id' => 6, 'title' => 'Fifth Book', 'weight' => 5 ),
 		array('id' => 6, 'title' => 'Fifth Book', 'weight' => 5 ),

+ 1 - 0
Test/Fixture/LogableCommentFixture.php

@@ -5,6 +5,7 @@ class LogableCommentFixture extends CakeTestFixture {
 		'id' => array('type' => 'integer', 'key' => 'primary'),
 		'id' => array('type' => 'integer', 'key' => 'primary'),
 		'content' => array('type' => 'string', 'length' => 255, 'null' => false),
 		'content' => array('type' => 'string', 'length' => 255, 'null' => false),
 	);
 	);
+
 	public $records = array(
 	public $records = array(
 		array('id' => 1, 'content' => 'I like it'),
 		array('id' => 1, 'content' => 'I like it'),
 		array('id' => 2, 'content' => 'I don\'t'),
 		array('id' => 2, 'content' => 'I don\'t'),

+ 1 - 0
Test/Fixture/LogableUserFixture.php

@@ -6,6 +6,7 @@ class LogableUserFixture extends CakeTestFixture {
 		'name' => array('type' => 'string', 'length' => 255, 'null' => false),
 		'name' => array('type' => 'string', 'length' => 255, 'null' => false),
 		'counter' => array('type' => 'integer', 'length' => 6, 'null' => false, 'default' => 1)
 		'counter' => array('type' => 'integer', 'length' => 6, 'null' => false, 'default' => 1)
 	);
 	);
+
 	public $records = array(
 	public $records = array(
 		array('id' => 66, 'name' => 'Alexander', 'counter' => 12),
 		array('id' => 66, 'name' => 'Alexander', 'counter' => 12),
 		array('id' => 301, 'name' => 'Steven', 'counter' => 12),
 		array('id' => 301, 'name' => 'Steven', 'counter' => 12),

+ 1 - 0
Test/Fixture/RevisionArticleFixture.php

@@ -14,6 +14,7 @@ class RevisionArticleFixture extends CakeTestFixture {
 			'title' => array('type' => 'string', 'null' => false, 'default' => null),
 			'title' => array('type' => 'string', 'null' => false, 'default' => null),
 			'content' => array('type' => 'text', 'null' => false, 'default' => null),
 			'content' => array('type' => 'text', 'null' => false, 'default' => null),
 			'indexes' => array('PRIMARY' => array('column' => 'id')));
 			'indexes' => array('PRIMARY' => array('column' => 'id')));
+
 	public $records = array(
 	public $records = array(
 		array(
 		array(
 			'id' => 1,
 			'id' => 1,

+ 1 - 0
Test/Fixture/RevisionArticlesRevFixture.php

@@ -10,6 +10,7 @@ class RevisionArticlesRevFixture extends CakeTestFixture {
 			'title' => array('type' => 'string', 'null' => false, 'default' => null),
 			'title' => array('type' => 'string', 'null' => false, 'default' => null),
 			'content' => array('type' => 'text', 'null' => false, 'default' => null),
 			'content' => array('type' => 'text', 'null' => false, 'default' => null),
 			'indexes' => array('PRIMARY' => array('column' => 'version_id')));
 			'indexes' => array('PRIMARY' => array('column' => 'version_id')));
+
 	public $records = array(
 	public $records = array(
 	);
 	);
 }
 }

+ 1 - 0
Test/Fixture/RevisionCommentFixture.php

@@ -11,6 +11,7 @@ class RevisionCommentFixture extends CakeTestFixture {
 			'title' => array('type' => 'string', 'null' => false, 'default' => null),
 			'title' => array('type' => 'string', 'null' => false, 'default' => null),
 			'content' => array('type' => 'text', 'null' => false, 'default' => null),
 			'content' => array('type' => 'text', 'null' => false, 'default' => null),
 			'indexes' => array('PRIMARY' => array('column' => 'id')));
 			'indexes' => array('PRIMARY' => array('column' => 'id')));
+
 	public $records = array(
 	public $records = array(
 		array(
 		array(
 			'id' => 1,
 			'id' => 1,

+ 1 - 0
Test/Fixture/RevisionCommentsRevFixture.php

@@ -12,6 +12,7 @@ class RevisionCommentsRevFixture extends CakeTestFixture {
 			'content' => array('type' => 'text', 'null' => false, 'default' => null),
 			'content' => array('type' => 'text', 'null' => false, 'default' => null),
 			'Tag' => array('type' => 'string', 'null' => true, 'default' => null)
 			'Tag' => array('type' => 'string', 'null' => true, 'default' => null)
 	);
 	);
+
 	public $records = array(
 	public $records = array(
 		array(
 		array(
 			'version_id' => 1,
 			'version_id' => 1,

+ 1 - 0
Test/Fixture/RevisionPostFixture.php

@@ -10,6 +10,7 @@ class RevisionPostFixture extends CakeTestFixture {
 			'title' => array('type' => 'string', 'null' => false, 'default' => null),
 			'title' => array('type' => 'string', 'null' => false, 'default' => null),
 			'content' => array('type' => 'text', 'null' => false, 'default' => null),
 			'content' => array('type' => 'text', 'null' => false, 'default' => null),
 			'indexes' => array('PRIMARY' => array('column' => 'id')));
 			'indexes' => array('PRIMARY' => array('column' => 'id')));
+
 	public $records = array(
 	public $records = array(
 		array(
 		array(
 			'id' => 1,
 			'id' => 1,

+ 1 - 0
Test/Fixture/RevisionPostsRevFixture.php

@@ -7,6 +7,7 @@ class RevisionPostsRevFixture extends CakeTestFixture {
 			'id' => array('type' => 'integer', 'null' => false, 'default' => null),
 			'id' => array('type' => 'integer', 'null' => false, 'default' => null),
 			'title' => array('type' => 'string', 'null' => false, 'default' => null),
 			'title' => array('type' => 'string', 'null' => false, 'default' => null),
 			'content' => array('type' => 'text', 'null' => false, 'default' => null));
 			'content' => array('type' => 'text', 'null' => false, 'default' => null));
+
 	public $records = array(
 	public $records = array(
 		array(
 		array(
 			'version_id' => 1,
 			'version_id' => 1,

+ 1 - 0
Test/Fixture/RevisionUserFixture.php

@@ -8,6 +8,7 @@ class RevisionUserFixture extends CakeTestFixture {
 			'created' => array('type' => 'date', 'null' => false, 'default' => null),
 			'created' => array('type' => 'date', 'null' => false, 'default' => null),
 			'indexes' => array('PRIMARY' => array('column' => 'id'))
 			'indexes' => array('PRIMARY' => array('column' => 'id'))
 			);
 			);
+
 	public $records = array(array(
 	public $records = array(array(
 			'id' => 1,
 			'id' => 1,
 			'name' => 'Alexander',
 			'name' => 'Alexander',

+ 3 - 1
View/Helper/CommonHelper.php

@@ -152,7 +152,9 @@ class CommonHelper extends AppHelper {
 			'meta' => '<link rel="alternate" type="application/rss+xml" title="%s" href="%s" />',
 			'meta' => '<link rel="alternate" type="application/rss+xml" title="%s" href="%s" />',
 		);
 		);
 		$content = array();
 		$content = array();
-		if (empty($url)) { return ''; }
+		if (empty($url)) {
+			return '';
+		}
 		if (empty($title)) {
 		if (empty($title)) {
 			$title = 'Diesen Feed abonnieren';
 			$title = 'Diesen Feed abonnieren';
 		}
 		}

+ 14 - 14
View/Helper/PhpThumbHelper.php

@@ -9,32 +9,32 @@ App::uses('AppHelper', 'View/Helper');
  */
  */
 class PhpThumbHelper extends AppHelper {
 class PhpThumbHelper extends AppHelper {
 
 
-	protected $PhpThumb;
+	public $PhpThumb;
 
 
-	protected $options;
+	public $options;
 
 
-	protected $file_extension;
+	public $fileExtension;
 
 
-	protected $cache_filename;
+	public $cacheFilename;
 
 
-	protected $thumb_data;
+	public $thumbData;
 
 
-	protected $error;
+	public $error;
 
 
-	protected $error_detail;
+	public $errorDetail;
 
 
-	protected function init($options = array()) {
+	public function init($options = array()) {
 		$this->options = $options;
 		$this->options = $options;
 		$this->set_file_extension();
 		$this->set_file_extension();
 		$this->thumbData = array();
 		$this->thumbData = array();
 		$this->error = 0;
 		$this->error = 0;
 	}
 	}
 
 
-	protected function set_file_extension() {
+	public function set_file_extension() {
 		$this->fileExtension = mb_substr($this->options['src'], mb_strrpos($this->options['src'], '.'), mb_strlen($this->options['src']));
 		$this->fileExtension = mb_substr($this->options['src'], mb_strrpos($this->options['src'], '.'), mb_strlen($this->options['src']));
 	}
 	}
 
 
-	protected function set_cache_filename() {
+	public function set_cache_filename() {
 		ksort($this->options);
 		ksort($this->options);
 		$filenameParts = array();
 		$filenameParts = array();
 		$cacheableProperties = array('src', 'new', 'w', 'h', 'wp', 'hp', 'wl', 'hl', 'ws', 'hs', 'f', 'q', 'sx', 'sy', 'sw', 'sh', 'zc', 'bc', 'bg', 'fltr');
 		$cacheableProperties = array('src', 'new', 'w', 'h', 'wp', 'hp', 'wl', 'hl', 'ws', 'hs', 'f', 'q', 'sx', 'sy', 'sw', 'sh', 'zc', 'bc', 'bg', 'fltr');
@@ -56,14 +56,14 @@ class PhpThumbHelper extends AppHelper {
 		$this->cacheFilename = $this->options['save_path'] . DS . md5($this->cacheFilename . $lastModified) . $this->fileExtension;
 		$this->cacheFilename = $this->options['save_path'] . DS . md5($this->cacheFilename . $lastModified) . $this->fileExtension;
 	}
 	}
 
 
-	protected function image_is_cached() {
+	public function image_is_cached() {
 		if (is_file($this->cacheFilename)) {
 		if (is_file($this->cacheFilename)) {
 			return true;
 			return true;
 		}
 		}
 		return false;
 		return false;
 	}
 	}
 
 
-	protected function create_thumb() {
+	public function create_thumb() {
 		if (!isset($this->PhpThumb) || !is_object($this->PhpThumb)) {
 		if (!isset($this->PhpThumb) || !is_object($this->PhpThumb)) {
 			App::import('Vendor', 'phpThumb', array('file' => 'phpThumb' . DS . 'phpthumb.class.php'));
 			App::import('Vendor', 'phpThumb', array('file' => 'phpThumb' . DS . 'phpthumb.class.php'));
 		}
 		}
@@ -106,7 +106,7 @@ class PhpThumbHelper extends AppHelper {
 		}
 		}
 	}
 	}
 
 
-	protected function get_thumb_data() {
+	public function get_thumb_data() {
 		$this->thumbData['error'] = $this->error;
 		$this->thumbData['error'] = $this->error;
 
 
 		if ($this->error) {
 		if ($this->error) {
@@ -127,7 +127,7 @@ class PhpThumbHelper extends AppHelper {
 		return $this->thumbData;
 		return $this->thumbData;
 	}
 	}
 
 
-	protected function validate() {
+	public function validate() {
 		if (!is_file($this->options['src'])) {
 		if (!is_file($this->options['src'])) {
 			$this->error = 1;
 			$this->error = 1;
 			$this->errorDetail = 'File ' . $this->options['src'] . ' does not exist';
 			$this->errorDetail = 'File ' . $this->options['src'] . ' does not exist';

+ 12 - 10
View/Helper/TextExtHelper.php

@@ -211,18 +211,19 @@ class TextExtHelper extends TextHelper {
 	 */
 	 */
 	public static function encodeText($text) {
 	public static function encodeText($text) {
 		$encmail = '';
 		$encmail = '';
-		for ($i = 0; $i < mb_strlen($text); $i++) {
+		$length = mb_strlen($text);
+		for ($i = 0; $i < $length; $i++) {
 			$encMod = mt_rand(0, 2);
 			$encMod = mt_rand(0, 2);
 			switch ($encMod) {
 			switch ($encMod) {
-			case 0: // None
-				$encmail .= mb_substr($text, $i, 1);
-				break;
-			case 1: // Decimal
-				$encmail .= "&#" . ord(mb_substr($text, $i, 1)) . ';';
-				break;
-			case 2: // Hexadecimal
-				$encmail .= "&#x" . dechex(ord(mb_substr($text, $i, 1))) . ';';
-				break;
+				case 0: // None
+					$encmail .= mb_substr($text, $i, 1);
+					break;
+				case 1: // Decimal
+					$encmail .= "&#" . ord(mb_substr($text, $i, 1)) . ';';
+					break;
+				case 2: // Hexadecimal
+					$encmail .= "&#x" . dechex(ord(mb_substr($text, $i, 1))) . ';';
+					break;
 			}
 			}
 		}
 		}
 		return $encmail;
 		return $encmail;
@@ -230,6 +231,7 @@ class TextExtHelper extends TextHelper {
 
 
 	/**
 	/**
 	 * Fix to allow shortened urls that do not break layout etc
 	 * Fix to allow shortened urls that do not break layout etc
+	 *
 	 * @param string $text
 	 * @param string $text
 	 * @param options (additionally - not yet supported by core):
 	 * @param options (additionally - not yet supported by core):
 	 * - stripProtocol: bool (defaults to true)
 	 * - stripProtocol: bool (defaults to true)

+ 2 - 2
View/Helper/TypographyHelper.php

@@ -228,7 +228,6 @@ class TypographyHelper extends AppHelper {
 		}
 		}
 
 
 		return preg_replace(array_keys($table), $table, $str);
 		return preg_replace(array_keys($table), $table, $str);
-
 	}
 	}
 
 
 	/**
 	/**
@@ -399,8 +398,9 @@ class TypographyHelper extends AppHelper {
 				$newstr .= $ex[$i];
 				$newstr .= $ex[$i];
 			}
 			}
 
 
-			if ($ct - 1 != $i)
+			if ($ct - 1 != $i) {
 				$newstr .= "pre>";
 				$newstr .= "pre>";
+			}
 		}
 		}
 
 
 		return $newstr;
 		return $newstr;