Skip to content

Commit 746f13b

Browse files
committed
改进Config类的has方法判断
1 parent 5384766 commit 746f13b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/think/Config.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ protected function parse(string $file, string $name): array
116116
*/
117117
public function has(string $name): bool
118118
{
119+
if (false === strpos($name, '.') && !isset($this->config[strtolower($name)])) {
120+
return false;
121+
}
122+
119123
return !is_null($this->get($name));
120124
}
121125

0 commit comments

Comments
 (0)