浏览代码

remove undocumented functions.

Mark Scherer 10 年之前
父节点
当前提交
843fe33262
共有 2 个文件被更改,包括 6 次插入20 次删除
  1. 5 1
      Lib/Error/MyErrorHandler.php
  2. 1 19
      Lib/Utility/Utility.php

+ 5 - 1
Lib/Error/MyErrorHandler.php

@@ -124,8 +124,12 @@ class MyErrorHandler extends ErrorHandler {
 	 */
 	public static function traceDetails() {
 		if (empty($_SERVER['REQUEST_URI']) || strpos($_SERVER['REQUEST_URI'], '/test.php?') === 0) {
-			return null;
+			return '';
 		}
+		if (!class_exists('Utility') || !class_exists('Router')) {
+			return '';
+		}
+
 		$currentUrl = Router::url(); //isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : 'n/a';
 		$refererUrl = Utility::getReferer(); //Router::getRequest()->url().'
 		$uid = (!empty($_SESSION) && !empty($_SESSION['Auth']['User']['id'])) ? $_SESSION['Auth']['User']['id'] : null;

+ 1 - 19
Lib/Utility/Utility.php

@@ -36,7 +36,7 @@ class Utility {
 	 * @param string $data The data to tokenize
 	 * @param string $separator The token to split the data on.
 	 * @param array $options
-	 * @return void
+	 * @return array
 	 */
 	public static function tokenize($data, $separator = ',', array $options = []) {
 		$defaults = [
@@ -489,24 +489,6 @@ class Utility {
 	}
 
 	/**
-	 * Removes all except A-Z,a-z,0-9 and allowedChars (allowedChars array) recursivly
-	 *
-	 */
-	public static function paranoidDeep($value) {
-		$value = is_array($value) ? array_map('self::paranoidDeep', $value) : Sanatize::paranoid($value, $this->allowedChars);
-		return $value;
-	}
-
-	/**
-	 * Transfers/removes all < > from text (remove TRUE/FALSE)
-	 *
-	 */
-	public static function htmlDeep($value) {
-		$value = is_array($value) ? array_map('self::htmlDeep', $value) : Sanatize::html($value, $this->removeChars);
-		return $value;
-	}
-
-	/**
 	 * Main deep method
 	 *
 	 */