Browse Source

Merge branch 'master' of https://github.com/yiisoft/yii2

tags/2.0.0-beta
Qiang Xue 12 years ago
parent
commit
6b770dad6e
  1. 2
      framework/db/ActiveRecord.php
  2. 2
      framework/db/ActiveRelation.php
  3. 2
      framework/web/UrlRule.php

2
framework/db/ActiveRecord.php

@ -28,7 +28,7 @@ use yii\helpers\StringHelper;
* @property TableSchema $tableSchema the schema information of the DB table associated with this AR class.
* @property array $oldAttributes the old attribute values (name-value pairs).
* @property array $dirtyAttributes the changed attribute values (name-value pairs).
* @property boolean $isPrimaryKey whether the record is new and should be inserted when calling [[save()]].
* @property boolean $isNewRecord whether the record is new and should be inserted when calling [[save()]].
* @property mixed $primaryKey the primary key value.
* @property mixed $oldPrimaryKey the old primary key value.
*

2
framework/db/ActiveRelation.php

@ -131,7 +131,7 @@ class ActiveRelation extends ActiveQuery
/**
* Finds the related records and populates them into the primary models.
* This method is internally by [[ActiveQuery]]. Do not call it directly.
* This method is internally used by [[ActiveQuery]]. Do not call it directly.
* @param string $name the relation name
* @param array $primaryModels primary models
* @return array the related models

2
framework/web/UrlRule.php

@ -125,7 +125,7 @@ class UrlRule extends Object
if (isset($this->defaults[$name])) {
$length = strlen($match[0][0]);
$offset = $match[0][1];
if ($this->pattern[$offset - 1] === '/' && $this->pattern[$offset + $length] === '/') {
if ($offset > 1 && $this->pattern[$offset - 1] === '/' && $this->pattern[$offset + $length] === '/') {
$tr["/<$name>"] = "(/(?P<$name>$pattern))?";
} else {
$tr["<$name>"] = "(?P<$name>$pattern)?";

Loading…
Cancel
Save