Skip to content

Commit

Permalink
Making static methods static.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Apr 14, 2010
1 parent f13e70b commit dbe4747
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
20 changes: 10 additions & 10 deletions cake/libs/sanitize.php
Expand Up @@ -40,7 +40,7 @@ class Sanitize {
* @access public
* @static
*/
function paranoid($string, $allowed = array()) {
public static function paranoid($string, $allowed = array()) {
$allow = null;
if (!empty($allowed)) {
foreach ($allowed as $value) {
Expand Down Expand Up @@ -68,7 +68,7 @@ function paranoid($string, $allowed = array()) {
* @access public
* @static
*/
function escape($string, $connection = 'default') {
public static function escape($string, $connection = 'default') {
$db =& ConnectionManager::getDataSource($connection);
if (is_numeric($string) || $string === null || is_bool($string)) {
return $string;
Expand Down Expand Up @@ -96,7 +96,7 @@ function escape($string, $connection = 'default') {
* @access public
* @static
*/
function html($string, $options = array()) {
public static function html($string, $options = array()) {
static $defaultCharset = false;
if ($defaultCharset === false) {
$defaultCharset = Configure::read('App.encoding');
Expand Down Expand Up @@ -127,7 +127,7 @@ function html($string, $options = array()) {
* @access public
* @static
*/
function stripWhitespace($str) {
public static function stripWhitespace($str) {
$r = preg_replace('/[\n\r\t]+/', '', $str);
return preg_replace('/\s{2,}/', ' ', $r);
}
Expand All @@ -140,7 +140,7 @@ function stripWhitespace($str) {
* @access public
* @static
*/
function stripImages($str) {
public static function stripImages($str) {
$str = preg_replace('/(<a[^>]*>)(<img[^>]+alt=")([^"]*)("[^>]*>)(<\/a>)/i', '$1$3$5<br />', $str);
$str = preg_replace('/(<img[^>]+alt=")([^"]*)("[^>]*>)/i', '$2<br />', $str);
$str = preg_replace('/<img[^>]*>/i', '', $str);
Expand All @@ -155,7 +155,7 @@ function stripImages($str) {
* @access public
* @static
*/
function stripScripts($str) {
public static function stripScripts($str) {
return preg_replace('/(<link[^>]+rel="[^"]*stylesheet"[^>]*>|<img[^>]*>|style="[^"]*")|<script[^>]*>.*?<\/script>|<style[^>]*>.*?<\/style>|<!--.*?-->/i', '', $str);
}

Expand All @@ -165,7 +165,7 @@ function stripScripts($str) {
* @param string $str String to sanitize
* @return string sanitized string
*/
public function stripAll($str) {
public static function stripAll($str) {
$str = Sanitize::stripWhitespace($str);
$str = Sanitize::stripImages($str);
$str = Sanitize::stripScripts($str);
Expand All @@ -186,7 +186,7 @@ public function stripAll($str) {
* @access public
* @static
*/
function stripTags() {
public static function stripTags() {
$params = params(func_get_args());
$str = $params[0];

Expand Down Expand Up @@ -217,7 +217,7 @@ function stripTags() {
* @access public
* @static
*/
function clean($data, $options = array()) {
public static function clean($data, $options = array()) {
if (empty($data)) {
return $data;
}
Expand Down Expand Up @@ -281,7 +281,7 @@ function clean($data, $options = array()) {
* @access public
* @static
*/
function formatColumns(&$model) {
public static function formatColumns(&$model) {
foreach ($model->data as $name => $values) {
if ($name == $model->alias) {
$curModel =& $model;
Expand Down
10 changes: 5 additions & 5 deletions cake/libs/security.php
Expand Up @@ -56,7 +56,7 @@ function &getInstance() {
* @access public
* @static
*/
function inactiveMins() {
public static function inactiveMins() {
switch (Configure::read('Security.level')) {
case 'high':
return 10;
Expand All @@ -78,7 +78,7 @@ function inactiveMins() {
* @access public
* @static
*/
function generateAuthKey() {
public static function generateAuthKey() {
if (!class_exists('String')) {
App::import('Core', 'String');
}
Expand Down Expand Up @@ -110,7 +110,7 @@ function validateAuthKey($authKey) {
* @access public
* @static
*/
function hash($string, $type = null, $salt = false) {
public static function hash($string, $type = null, $salt = false) {
$_this =& Security::getInstance();

if ($salt) {
Expand Down Expand Up @@ -154,7 +154,7 @@ function hash($string, $type = null, $salt = false) {
* @static
* @see Security::hash()
*/
function setHash($hash) {
public static function setHash($hash) {
$_this =& Security::getInstance();
$_this->hashType = $hash;
}
Expand All @@ -168,7 +168,7 @@ function setHash($hash) {
* @access public
* @static
*/
function cipher($text, $key) {
public static function cipher($text, $key) {
if (empty($key)) {
trigger_error(__('You cannot use an empty key for Security::cipher()', true), E_USER_WARNING);
return '';
Expand Down
8 changes: 4 additions & 4 deletions cake/libs/string.php
Expand Up @@ -34,7 +34,7 @@ class String {
* @return RFC 4122 UUID
* @static
*/
function uuid() {
public static function uuid() {
$node = env('SERVER_ADDR');
$pid = null;

Expand Down Expand Up @@ -114,7 +114,7 @@ function uuid() {
* @access public
* @static
*/
function tokenize($data, $separator = ',', $leftBound = '(', $rightBound = ')') {
public static function tokenize($data, $separator = ',', $leftBound = '(', $rightBound = ')') {
if (empty($data) || is_array($data)) {
return $data;
}
Expand Down Expand Up @@ -205,7 +205,7 @@ function tokenize($data, $separator = ',', $leftBound = '(', $rightBound = ')')
* @access public
* @static
*/
function insert($str, $data, $options = array()) {
public static function insert($str, $data, $options = array()) {
$defaults = array(
'before' => ':', 'after' => null, 'escape' => '\\', 'format' => null, 'clean' => false
);
Expand Down Expand Up @@ -272,7 +272,7 @@ function insert($str, $data, $options = array()) {
* @static
* @see String::insert()
*/
function cleanInsert($str, $options) {
public static function cleanInsert($str, $options) {
$clean = $options['clean'];
if (!$clean) {
return $str;
Expand Down

0 comments on commit dbe4747

Please sign in to comment.