From 22cd051a7b05d679ae3e3c86679c3c40a1747074 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 13 Feb 2018 18:32:34 -0600 Subject: [PATCH] Cleanup: prefix private constants with 'p_' I have mixed feelings about this, but it makes the behavior of prefixing p_ to private class parts and pr_ to protected class parts. Stick to lower case for the prefix but continue to use upper case for the constant name. --- common/base/classes/base_path.php | 14 +++++++------- common/theme/classes/theme_html.php | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/base/classes/base_path.php b/common/base/classes/base_path.php index ec8926a..10545a0 100644 --- a/common/base/classes/base_path.php +++ b/common/base/classes/base_path.php @@ -65,14 +65,14 @@ require_once('common/base/classes/base_array.php'); class c_base_path extends c_base_rfc_string { use t_base_return_value_exact; - private const DEFAULT_ALLOWED_METHODS = [ + private const p_DEFAULT_ALLOWED_METHODS = [ c_base_http::HTTP_METHOD_GET => c_base_http::HTTP_METHOD_GET, c_base_http::HTTP_METHOD_POST => c_base_http::HTTP_METHOD_POST, c_base_http::HTTP_METHOD_HEAD => c_base_http::HTTP_METHOD_HEAD, c_base_http::HTTP_METHOD_OPTIONS => c_base_http::HTTP_METHOD_OPTIONS, ]; - private const DEFAULT_SANITIZE_HTML = [ + private const p_DEFAULT_SANITIZE_HTML = [ 'flags' => ENT_HTML5 | ENT_NOQUOTES | ENT_DISALLOWED | ENT_SUBSTITUTE, 'encoding' => 'UTF-8', ]; @@ -131,8 +131,8 @@ class c_base_path extends c_base_rfc_string { $this->include_directory = NULL; $this->include_name = NULL; - $this->allowed_methods = self::DEFAULT_ALLOWED_METHODS; - $this->sanitize_html = self::DEFAULT_SANITIZE_HTML; + $this->allowed_methods = self::p_DEFAULT_ALLOWED_METHODS; + $this->sanitize_html = self::p_DEFAULT_SANITIZE_HTML; $this->path_tree = NULL; } @@ -690,7 +690,7 @@ class c_base_path extends c_base_rfc_string { } if (!is_array($this->sanitize_html)) { - $this->sanitize_html = static::DEFAULT_SANITIZE_HTML; + $this->sanitize_html = static::p_DEFAULT_SANITIZE_HTML; } if (!is_null($flags)) { @@ -941,7 +941,7 @@ class c_base_path extends c_base_rfc_string { */ public function get_allowed_methods() { if (!is_array($this->allowed_methods)) { - $this->allowed_methods = static::DEFAULT_ALLOWED_METHODS; + $this->allowed_methods = static::p_DEFAULT_ALLOWED_METHODS; } return c_base_return_array::s_new($this->allowed_methods); @@ -958,7 +958,7 @@ class c_base_path extends c_base_rfc_string { */ public function get_sanitize_html() { if (!is_array($this->sanitize_html)) { - $this->sanitize_html = static::DEFAULT_SANITIZE_HTML; + $this->sanitize_html = static::p_DEFAULT_SANITIZE_HTML; } return c_base_return_array::s_new($this->sanitize_html); diff --git a/common/theme/classes/theme_html.php b/common/theme/classes/theme_html.php index 5fd46e4..b2c0589 100644 --- a/common/theme/classes/theme_html.php +++ b/common/theme/classes/theme_html.php @@ -28,7 +28,7 @@ require_once('common/base/classes/base_mime.php'); class c_theme_html extends c_base_return { const DEFAULT_MAX_RECURSION_DEPTH = 16384; - private const DEFAULT_SANITIZE_HTML = [ + private const p_DEFAULT_SANITIZE_HTML = [ 'flags' => ENT_HTML5 | ENT_NOQUOTES | ENT_DISALLOWED | ENT_SUBSTITUTE, 'encoding' => 'UTF-8', 'double_encode' => FALSE, @@ -6483,7 +6483,7 @@ class c_theme_html extends c_base_return { private function p_html_entities_tag($tag) { $text = $tag->get_text()->get_value_exact(); if ($tag->get_encode_text()->get_value_exact()) { - return htmlentities($text, self::DEFAULT_SANITIZE_HTML['flags'], self::DEFAULT_SANITIZE_HTML['encoding'], self::DEFAULT_SANITIZE_HTML['double_encode']); + return htmlentities($text, self::p_DEFAULT_SANITIZE_HTML['flags'], self::p_DEFAULT_SANITIZE_HTML['encoding'], self::p_DEFAULT_SANITIZE_HTML['double_encode']); } return $text; -- 1.8.3.1