浏览代码

Check before using deprecated Js helper

Mark Scherer 10 年之前
父节点
当前提交
791f64fd20
共有 2 个文件被更改,包括 6 次插入4 次删除
  1. 3 3
      config/bootstrap.php
  2. 3 1
      src/Template/Element/pagination.ctp

+ 3 - 3
config/bootstrap.php

@@ -175,8 +175,8 @@ function extractFileInfo($filename, $type = null) {
  * Improves it by not returning non-file-name characters from url files if specified.
  * So "filename.ext?foo=bar#hash" would simply be "filename.ext" then.
  *
- * @param string filename to check on
- * @param string type (extension/ext, filename/file, basename/base, dirname/dir)
+ * @param string $filename to check on
+ * @param string $type (extension/ext, filename/file, basename/base, dirname/dir)
  * @param bool $fromUrl
  * @return mixed
  */
@@ -199,7 +199,7 @@ function extractPathInfo($filename, $type = null, $fromUrl = false) {
 			$infoType = PATHINFO_DIRNAME;
 			break;
 		default:
-			$infoType = null;
+			$infoType = $type;
 	}
 	$result = pathinfo($filename, $infoType);
 	if ($fromUrl) {

+ 3 - 1
src/Template/Element/pagination.ctp

@@ -74,5 +74,7 @@ $escape = isset($escape) ? $escape : true;
 	});
 });";
 
-	$this->Js->buffer($script);
+	if (isset($this->Js)) {
+		$this->Js->buffer($script);
+	}
 } ?>