Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
be2828d5
Commit
be2828d5
authored
Oct 11, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #5484: Fixed potential string suffix detection failure on 5.5.11
parent
7ba770eb
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
14 additions
and
13 deletions
+14
-13
Generator.php
extensions/gii/generators/model/Generator.php
+2
-2
Generator.php
extensions/sphinx/gii/model/Generator.php
+2
-2
CHANGELOG.md
framework/CHANGELOG.md
+2
-1
HelpController.php
framework/console/controllers/HelpController.php
+1
-1
MessageController.php
framework/console/controllers/MessageController.php
+1
-1
CheckboxColumn.php
framework/grid/CheckboxColumn.php
+1
-1
BaseHtml.php
framework/helpers/BaseHtml.php
+2
-2
Target.php
framework/log/Target.php
+1
-1
UrlManager.php
framework/web/UrlManager.php
+1
-1
UrlRule.php
framework/web/UrlRule.php
+1
-1
No files found.
extensions/gii/generators/model/Generator.php
View file @
be2828d5
...
@@ -479,7 +479,7 @@ class Generator extends \yii\gii\Generator
...
@@ -479,7 +479,7 @@ class Generator extends \yii\gii\Generator
if
(
$this
->
isReservedKeyword
(
$this
->
modelClass
))
{
if
(
$this
->
isReservedKeyword
(
$this
->
modelClass
))
{
$this
->
addError
(
'modelClass'
,
'Class name cannot be a reserved PHP keyword.'
);
$this
->
addError
(
'modelClass'
,
'Class name cannot be a reserved PHP keyword.'
);
}
}
if
((
empty
(
$this
->
tableName
)
||
substr_compare
(
$this
->
tableName
,
'*'
,
-
1
))
&&
$this
->
modelClass
==
''
)
{
if
((
empty
(
$this
->
tableName
)
||
substr_compare
(
$this
->
tableName
,
'*'
,
-
1
,
1
))
&&
$this
->
modelClass
==
''
)
{
$this
->
addError
(
'modelClass'
,
'Model Class cannot be blank if table name does not end with asterisk.'
);
$this
->
addError
(
'modelClass'
,
'Model Class cannot be blank if table name does not end with asterisk.'
);
}
}
}
}
...
@@ -489,7 +489,7 @@ class Generator extends \yii\gii\Generator
...
@@ -489,7 +489,7 @@ class Generator extends \yii\gii\Generator
*/
*/
public
function
validateTableName
()
public
function
validateTableName
()
{
{
if
(
strpos
(
$this
->
tableName
,
'*'
)
!==
false
&&
substr_compare
(
$this
->
tableName
,
'*'
,
-
1
))
{
if
(
strpos
(
$this
->
tableName
,
'*'
)
!==
false
&&
substr_compare
(
$this
->
tableName
,
'*'
,
-
1
,
1
))
{
$this
->
addError
(
'tableName'
,
'Asterisk is only allowed as the last character.'
);
$this
->
addError
(
'tableName'
,
'Asterisk is only allowed as the last character.'
);
return
;
return
;
...
...
extensions/sphinx/gii/model/Generator.php
View file @
be2828d5
...
@@ -267,7 +267,7 @@ class Generator extends \yii\gii\Generator
...
@@ -267,7 +267,7 @@ class Generator extends \yii\gii\Generator
if
(
$this
->
isReservedKeyword
(
$this
->
modelClass
))
{
if
(
$this
->
isReservedKeyword
(
$this
->
modelClass
))
{
$this
->
addError
(
'modelClass'
,
'Class name cannot be a reserved PHP keyword.'
);
$this
->
addError
(
'modelClass'
,
'Class name cannot be a reserved PHP keyword.'
);
}
}
if
((
empty
(
$this
->
indexName
)
||
substr_compare
(
$this
->
indexName
,
'*'
,
-
1
))
&&
$this
->
modelClass
==
''
)
{
if
((
empty
(
$this
->
indexName
)
||
substr_compare
(
$this
->
indexName
,
'*'
,
-
1
,
1
))
&&
$this
->
modelClass
==
''
)
{
$this
->
addError
(
'modelClass'
,
'Model Class cannot be blank if table name does not end with asterisk.'
);
$this
->
addError
(
'modelClass'
,
'Model Class cannot be blank if table name does not end with asterisk.'
);
}
}
}
}
...
@@ -277,7 +277,7 @@ class Generator extends \yii\gii\Generator
...
@@ -277,7 +277,7 @@ class Generator extends \yii\gii\Generator
*/
*/
public
function
validateIndexName
()
public
function
validateIndexName
()
{
{
if
(
strpos
(
$this
->
indexName
,
'*'
)
!==
false
&&
substr_compare
(
$this
->
indexName
,
'*'
,
-
1
))
{
if
(
strpos
(
$this
->
indexName
,
'*'
)
!==
false
&&
substr_compare
(
$this
->
indexName
,
'*'
,
-
1
,
1
))
{
$this
->
addError
(
'indexName'
,
'Asterisk is only allowed as the last character.'
);
$this
->
addError
(
'indexName'
,
'Asterisk is only allowed as the last character.'
);
return
;
return
;
...
...
framework/CHANGELOG.md
View file @
be2828d5
...
@@ -16,7 +16,8 @@ Yii Framework 2 Change Log
...
@@ -16,7 +16,8 @@ Yii Framework 2 Change Log
-
Bug #5408: Gii console command incorrectly reports errors when there is actually no error (qiangxue)
-
Bug #5408: Gii console command incorrectly reports errors when there is actually no error (qiangxue)
-
Bug #5423:
`yii\behaviors\Cors`
causes "undefined index" error when its
`cors`
is configured (qiangxue)
-
Bug #5423:
`yii\behaviors\Cors`
causes "undefined index" error when its
`cors`
is configured (qiangxue)
-
Bug #5424:
`Html::addCssStyle()`
wasn't correctly setting style passed in array (kartik-v, samdark)
-
Bug #5424:
`Html::addCssStyle()`
wasn't correctly setting style passed in array (kartik-v, samdark)
-
Bug #5435: Added extra checks to
`yii\rbac\DbManager`
to prevent database exceptions when
`$userId`
is empty (samdark)
-
Bug #5435: Added extra checks to
`yii\rbac\DbManager`
to prevent database exceptions when
`$userId`
is empty (samdark)
-
Bug #5484: Fixed potential string suffix detection failure on 5.5.11 (qiangxue)
-
Bug: Date and time formatting now assumes UTC as the timezone for input dates unless a timezone is explicitly given (cebe)
-
Bug: Date and time formatting now assumes UTC as the timezone for input dates unless a timezone is explicitly given (cebe)
-
Enh #4040: Added
`$viewFile`
and
`$params`
to the
`EVENT_BEFORE_RENDER`
and
`EVENT_AFTER_RENDER`
events for
`View`
(qiangxue)
-
Enh #4040: Added
`$viewFile`
and
`$params`
to the
`EVENT_BEFORE_RENDER`
and
`EVENT_AFTER_RENDER`
events for
`View`
(qiangxue)
-
Enh #4275: Added
`removeChildren()`
to
`yii\rbac\ManagerInterface`
and implementations (samdark)
-
Enh #4275: Added
`removeChildren()`
to
`yii\rbac\ManagerInterface`
and implementations (samdark)
...
...
framework/console/controllers/HelpController.php
View file @
be2828d5
...
@@ -149,7 +149,7 @@ class HelpController extends Controller
...
@@ -149,7 +149,7 @@ class HelpController extends Controller
if
(
is_dir
(
$controllerPath
))
{
if
(
is_dir
(
$controllerPath
))
{
$files
=
scandir
(
$controllerPath
);
$files
=
scandir
(
$controllerPath
);
foreach
(
$files
as
$file
)
{
foreach
(
$files
as
$file
)
{
if
(
!
empty
(
$file
)
&&
substr_compare
(
$file
,
'Controller.php'
,
-
14
)
===
0
)
{
if
(
!
empty
(
$file
)
&&
substr_compare
(
$file
,
'Controller.php'
,
-
14
,
14
)
===
0
)
{
$controllerClass
=
$module
->
controllerNamespace
.
'\\'
.
substr
(
basename
(
$file
),
0
,
-
4
);
$controllerClass
=
$module
->
controllerNamespace
.
'\\'
.
substr
(
basename
(
$file
),
0
,
-
4
);
if
(
$this
->
validateControllerClass
(
$controllerClass
))
{
if
(
$this
->
validateControllerClass
(
$controllerClass
))
{
$commands
[]
=
$prefix
.
Inflector
::
camel2id
(
substr
(
basename
(
$file
),
0
,
-
14
));
$commands
[]
=
$prefix
.
Inflector
::
camel2id
(
substr
(
basename
(
$file
),
0
,
-
14
));
...
...
framework/console/controllers/MessageController.php
View file @
be2828d5
...
@@ -328,7 +328,7 @@ class MessageController extends Controller
...
@@ -328,7 +328,7 @@ class MessageController extends Controller
ksort
(
$existingMessages
);
ksort
(
$existingMessages
);
foreach
(
$existingMessages
as
$message
=>
$translation
)
{
foreach
(
$existingMessages
as
$message
=>
$translation
)
{
if
(
!
isset
(
$merged
[
$message
])
&&
!
isset
(
$todo
[
$message
])
&&
!
$removeUnused
)
{
if
(
!
isset
(
$merged
[
$message
])
&&
!
isset
(
$todo
[
$message
])
&&
!
$removeUnused
)
{
if
(
!
empty
(
$translation
)
&&
strncmp
(
$translation
,
'@@'
,
2
)
===
0
&&
substr_compare
(
$translation
,
'@@'
,
-
2
)
===
0
)
{
if
(
!
empty
(
$translation
)
&&
strncmp
(
$translation
,
'@@'
,
2
)
===
0
&&
substr_compare
(
$translation
,
'@@'
,
-
2
,
2
)
===
0
)
{
$todo
[
$message
]
=
$translation
;
$todo
[
$message
]
=
$translation
;
}
else
{
}
else
{
$todo
[
$message
]
=
'@@'
.
$translation
.
'@@'
;
$todo
[
$message
]
=
'@@'
.
$translation
.
'@@'
;
...
...
framework/grid/CheckboxColumn.php
View file @
be2828d5
...
@@ -65,7 +65,7 @@ class CheckboxColumn extends Column
...
@@ -65,7 +65,7 @@ class CheckboxColumn extends Column
if
(
empty
(
$this
->
name
))
{
if
(
empty
(
$this
->
name
))
{
throw
new
InvalidConfigException
(
'The "name" property must be set.'
);
throw
new
InvalidConfigException
(
'The "name" property must be set.'
);
}
}
if
(
substr_compare
(
$this
->
name
,
'[]'
,
-
2
))
{
if
(
substr_compare
(
$this
->
name
,
'[]'
,
-
2
,
2
))
{
$this
->
name
.=
'[]'
;
$this
->
name
.=
'[]'
;
}
}
}
}
...
...
framework/helpers/BaseHtml.php
View file @
be2828d5
...
@@ -785,13 +785,13 @@ class BaseHtml
...
@@ -785,13 +785,13 @@ class BaseHtml
if
(
!
array_key_exists
(
'size'
,
$options
))
{
if
(
!
array_key_exists
(
'size'
,
$options
))
{
$options
[
'size'
]
=
4
;
$options
[
'size'
]
=
4
;
}
}
if
(
!
empty
(
$options
[
'multiple'
])
&&
!
empty
(
$name
)
&&
substr_compare
(
$name
,
'[]'
,
-
2
))
{
if
(
!
empty
(
$options
[
'multiple'
])
&&
!
empty
(
$name
)
&&
substr_compare
(
$name
,
'[]'
,
-
2
,
2
))
{
$name
.=
'[]'
;
$name
.=
'[]'
;
}
}
$options
[
'name'
]
=
$name
;
$options
[
'name'
]
=
$name
;
if
(
isset
(
$options
[
'unselect'
]))
{
if
(
isset
(
$options
[
'unselect'
]))
{
// add a hidden field so that if the list box has no option being selected, it still submits a value
// add a hidden field so that if the list box has no option being selected, it still submits a value
if
(
!
empty
(
$name
)
&&
substr_compare
(
$name
,
'[]'
,
-
2
)
===
0
)
{
if
(
!
empty
(
$name
)
&&
substr_compare
(
$name
,
'[]'
,
-
2
,
2
)
===
0
)
{
$name
=
substr
(
$name
,
0
,
-
2
);
$name
=
substr
(
$name
,
0
,
-
2
);
}
}
$hidden
=
static
::
hiddenInput
(
$name
,
$options
[
'unselect'
]);
$hidden
=
static
::
hiddenInput
(
$name
,
$options
[
'unselect'
]);
...
...
framework/log/Target.php
View file @
be2828d5
...
@@ -204,7 +204,7 @@ abstract class Target extends Component
...
@@ -204,7 +204,7 @@ abstract class Target extends Component
$matched
=
empty
(
$categories
);
$matched
=
empty
(
$categories
);
foreach
(
$categories
as
$category
)
{
foreach
(
$categories
as
$category
)
{
if
(
$message
[
2
]
===
$category
||
!
empty
(
$category
)
&&
substr_compare
(
$category
,
'*'
,
-
1
)
===
0
&&
strpos
(
$message
[
2
],
rtrim
(
$category
,
'*'
))
===
0
)
{
if
(
$message
[
2
]
===
$category
||
!
empty
(
$category
)
&&
substr_compare
(
$category
,
'*'
,
-
1
,
1
)
===
0
&&
strpos
(
$message
[
2
],
rtrim
(
$category
,
'*'
))
===
0
)
{
$matched
=
true
;
$matched
=
true
;
break
;
break
;
}
}
...
...
framework/web/UrlManager.php
View file @
be2828d5
...
@@ -243,7 +243,7 @@ class UrlManager extends Component
...
@@ -243,7 +243,7 @@ class UrlManager extends Component
$suffix
=
(
string
)
$this
->
suffix
;
$suffix
=
(
string
)
$this
->
suffix
;
if
(
$suffix
!==
''
&&
$pathInfo
!==
''
)
{
if
(
$suffix
!==
''
&&
$pathInfo
!==
''
)
{
$n
=
strlen
(
$this
->
suffix
);
$n
=
strlen
(
$this
->
suffix
);
if
(
substr_compare
(
$pathInfo
,
$this
->
suffix
,
-
$n
)
===
0
)
{
if
(
substr_compare
(
$pathInfo
,
$this
->
suffix
,
-
$n
,
$n
)
===
0
)
{
$pathInfo
=
substr
(
$pathInfo
,
0
,
-
$n
);
$pathInfo
=
substr
(
$pathInfo
,
0
,
-
$n
);
if
(
$pathInfo
===
''
)
{
if
(
$pathInfo
===
''
)
{
// suffix alone is not allowed
// suffix alone is not allowed
...
...
framework/web/UrlRule.php
View file @
be2828d5
...
@@ -219,7 +219,7 @@ class UrlRule extends Object implements UrlRuleInterface
...
@@ -219,7 +219,7 @@ class UrlRule extends Object implements UrlRuleInterface
$suffix
=
(
string
)
(
$this
->
suffix
===
null
?
$manager
->
suffix
:
$this
->
suffix
);
$suffix
=
(
string
)
(
$this
->
suffix
===
null
?
$manager
->
suffix
:
$this
->
suffix
);
if
(
$suffix
!==
''
&&
$pathInfo
!==
''
)
{
if
(
$suffix
!==
''
&&
$pathInfo
!==
''
)
{
$n
=
strlen
(
$suffix
);
$n
=
strlen
(
$suffix
);
if
(
substr_compare
(
$pathInfo
,
$suffix
,
-
$n
)
===
0
)
{
if
(
substr_compare
(
$pathInfo
,
$suffix
,
-
$n
,
$n
)
===
0
)
{
$pathInfo
=
substr
(
$pathInfo
,
0
,
-
$n
);
$pathInfo
=
substr
(
$pathInfo
,
0
,
-
$n
);
if
(
$pathInfo
===
''
)
{
if
(
$pathInfo
===
''
)
{
// suffix alone is not allowed
// suffix alone is not allowed
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment