浏览代码

Merge branch 'master' into 2.5

ADmad 12 年之前
父节点
当前提交
961f9d7669
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 3 2
      lib/Cake/Model/Datasource/Database/Sqlserver.php
  2. 2 3
      lib/Cake/Network/Email/CakeEmail.php

+ 3 - 2
lib/Cake/Model/Datasource/Database/Sqlserver.php

@@ -205,7 +205,8 @@ class Sqlserver extends DboSource {
 			return $cache;
 		}
 		$fields = array();
-		$table = $this->fullTableName($model, false);
+		$table = $this->fullTableName($model, false, false);
+		$schema = $model->schemaName;
 		$cols = $this->_execute(
 			"SELECT
 				COLUMN_NAME as Field,
@@ -216,7 +217,7 @@ class Sqlserver extends DboSource {
 				COLUMNPROPERTY(OBJECT_ID('" . $table . "'), COLUMN_NAME, 'IsIdentity') as [Key],
 				NUMERIC_SCALE as Size
 			FROM INFORMATION_SCHEMA.COLUMNS
-			WHERE TABLE_NAME = '" . $table . "'"
+			WHERE TABLE_NAME = '" . $table . "'" . ($schema ? " AND TABLE_SCHEMA = '" . $schema . "'" : '')
 		);
 		if (!$cols) {
 			throw new CakeException(__d('cake_dev', 'Could not describe table for %s', $table));

+ 2 - 3
lib/Cake/Network/Email/CakeEmail.php

@@ -1,7 +1,5 @@
 <?php
 /**
- * CakePHP Email
- *
  * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  *
@@ -1029,9 +1027,10 @@ class CakeEmail {
 				}
 				$fileInfo['data'] = chunk_split(base64_encode($fileInfo['data']), 76, "\r\n");
 			} else {
+				$fileName = $fileInfo['file'];
 				$fileInfo['file'] = realpath($fileInfo['file']);
 				if ($fileInfo['file'] === false || !file_exists($fileInfo['file'])) {
-					throw new SocketException(__d('cake_dev', 'File not found: "%s"', $fileInfo['file']));
+					throw new SocketException(__d('cake_dev', 'File not found: "%s"', $fileName));
 				}
 				if (is_int($name)) {
 					$name = basename($fileInfo['file']);