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
07f01bcf
Commit
07f01bcf
authored
Jul 23, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used substr_compare instead of substr when we don't care about result
parent
5c767e5d
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
21 additions
and
21 deletions
+21
-21
PhpDocController.php
build/controllers/PhpDocController.php
+6
-6
TypeDoc.php
extensions/apidoc/models/TypeDoc.php
+1
-1
BaseRenderer.php
extensions/apidoc/renderers/BaseRenderer.php
+1
-1
seeAlso.php
extensions/apidoc/templates/html/views/seeAlso.php
+1
-1
OAuth1.php
extensions/authclient/OAuth1.php
+1
-1
OpenId.php
extensions/authclient/OpenId.php
+3
-3
Generator.php
extensions/gii/generators/model/Generator.php
+1
-1
Generator.php
extensions/gii/generators/module/Generator.php
+1
-1
Generator.php
extensions/sphinx/gii/model/Generator.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
+1
-1
UrlManager.php
framework/web/UrlManager.php
+1
-1
UrlRule.php
framework/web/UrlRule.php
+1
-1
No files found.
build/controllers/PhpDocController.php
View file @
07f01bcf
...
...
@@ -170,7 +170,7 @@ class PhpDocController extends Controller
$namespaceLine
=
''
;
$contentAfterNamespace
=
false
;
foreach
(
$lines
as
$i
=>
$line
)
{
if
(
substr
(
trim
(
$line
),
0
,
9
)
===
'namespace'
)
{
if
(
substr
_compare
(
trim
(
$line
),
'namespace'
,
0
,
9
)
===
0
)
{
$namespace
=
$i
;
$namespaceLine
=
trim
(
$line
);
}
elseif
(
$namespace
!==
false
&&
trim
(
$line
)
!==
''
)
{
...
...
@@ -275,13 +275,13 @@ class PhpDocController extends Controller
// TODO move these checks to different action
$lines
=
explode
(
"
\n
"
,
$newDoc
);
if
(
trim
(
$lines
[
1
])
==
'*'
||
substr
(
trim
(
$lines
[
1
]),
0
,
3
)
==
'* @'
)
{
if
(
trim
(
$lines
[
1
])
==
'*'
||
substr
_compare
(
trim
(
$lines
[
1
]),
'* @'
,
0
,
3
)
===
0
)
{
$this
->
stderr
(
"[WARN] Class
$className
has no short description.
\n
"
,
Console
::
FG_YELLOW
,
Console
::
BOLD
);
}
foreach
(
$lines
as
$line
)
{
if
(
substr
(
trim
(
$line
),
0
,
9
)
==
'* @since '
)
{
if
(
substr
_compare
(
trim
(
$line
),
'* @since '
,
0
,
9
)
===
0
)
{
$seenSince
=
true
;
}
elseif
(
substr
(
trim
(
$line
),
0
,
10
)
==
'* @author '
)
{
}
elseif
(
substr
_compare
(
trim
(
$line
),
'* @author '
,
0
,
10
)
===
0
)
{
$seenAuthor
=
true
;
}
}
...
...
@@ -350,13 +350,13 @@ class PhpDocController extends Controller
$propertyPart
=
false
;
$propertyPosition
=
false
;
foreach
(
$lines
as
$i
=>
$line
)
{
if
(
substr
(
trim
(
$line
),
0
,
12
)
==
'* @property '
)
{
if
(
substr
_compare
(
trim
(
$line
),
'* @property '
,
0
,
12
)
===
0
)
{
$propertyPart
=
true
;
}
elseif
(
$propertyPart
&&
trim
(
$line
)
==
'*'
)
{
$propertyPosition
=
$i
;
$propertyPart
=
false
;
}
if
(
substr
(
trim
(
$line
),
0
,
10
)
==
'* @author '
&&
$propertyPosition
===
false
)
{
if
(
substr
_compare
(
trim
(
$line
),
'* @author '
,
0
,
10
)
===
0
&&
$propertyPosition
===
false
)
{
$propertyPosition
=
$i
-
1
;
$propertyPart
=
false
;
}
...
...
extensions/apidoc/models/TypeDoc.php
View file @
07f01bcf
...
...
@@ -46,7 +46,7 @@ class TypeDoc extends BaseDoc
}
}
}
if
(
substr
(
$subjectName
,
-
2
,
2
)
==
'()'
)
{
if
(
substr
_compare
(
$subjectName
,
'()'
,
-
2
,
2
)
===
0
)
{
return
null
;
}
if
(
$this
->
properties
===
null
)
{
...
...
extensions/apidoc/renderers/BaseRenderer.php
View file @
07f01bcf
...
...
@@ -72,7 +72,7 @@ abstract class BaseRenderer extends Component
foreach
(
$types
as
$type
)
{
$postfix
=
''
;
if
(
!
is_object
(
$type
))
{
if
(
substr
(
$type
,
-
2
,
2
)
==
'[]'
)
{
if
(
substr
_compare
(
$type
,
'[]'
,
-
2
,
2
)
===
0
)
{
$postfix
=
'[]'
;
$type
=
substr
(
$type
,
0
,
-
2
);
}
...
...
extensions/apidoc/templates/html/views/seeAlso.php
View file @
07f01bcf
...
...
@@ -23,7 +23,7 @@ if (empty($see)) {
}
else
{
echo
'<p>See also:</p><ul>'
;
foreach
(
$see
as
$ref
)
{
if
(
substr
(
$ref
,
-
1
,
1
)
!=
'>'
)
{
if
(
substr
_compare
(
$ref
,
'>'
,
-
1
,
1
)
)
{
$ref
.=
'.'
;
}
echo
"<li>
$ref
</li>"
;
...
...
extensions/authclient/OAuth1.php
View file @
07f01bcf
...
...
@@ -349,7 +349,7 @@ class OAuth1 extends BaseOAuth
$headerParams
[]
=
'realm="'
.
rawurlencode
(
$realm
)
.
'"'
;
}
foreach
(
$params
as
$key
=>
$value
)
{
if
(
substr
(
$key
,
0
,
5
)
!=
'oauth'
)
{
if
(
substr
_compare
(
$key
,
'oauth'
,
0
,
5
)
)
{
continue
;
}
$headerParams
[]
=
rawurlencode
(
$key
)
.
'="'
.
rawurlencode
(
$value
)
.
'"'
;
...
...
extensions/authclient/OpenId.php
View file @
07f01bcf
...
...
@@ -761,7 +761,7 @@ class OpenId extends BaseClient implements ClientInterface
}
else
{
// 'ax' prefix is either undefined, or points to another extension, so we search for another prefix
foreach
(
$this
->
data
as
$key
=>
$value
)
{
if
(
substr
(
$key
,
0
,
strlen
(
'openid_ns_'
))
==
'openid_ns_'
&&
$value
==
'http://openid.net/srv/ax/1.0'
)
{
if
(
substr
_compare
(
$key
,
'openid_ns_'
,
0
,
10
)
===
0
&&
$value
==
'http://openid.net/srv/ax/1.0'
)
{
$alias
=
substr
(
$key
,
strlen
(
'openid_ns_'
));
break
;
}
...
...
@@ -775,7 +775,7 @@ class OpenId extends BaseClient implements ClientInterface
$attributes
=
[];
foreach
(
$this
->
data
as
$key
=>
$value
)
{
$keyMatch
=
'openid_'
.
$alias
.
'_value_'
;
if
(
substr
(
$key
,
0
,
strlen
(
$keyMatch
))
!=
$keyMatch
)
{
if
(
substr
_compare
(
$key
,
$keyMatch
,
0
,
strlen
(
$keyMatch
))
)
{
continue
;
}
$key
=
substr
(
$key
,
strlen
(
$keyMatch
));
...
...
@@ -802,7 +802,7 @@ class OpenId extends BaseClient implements ClientInterface
$sregToAx
=
array_flip
(
$this
->
axToSregMap
);
foreach
(
$this
->
data
as
$key
=>
$value
)
{
$keyMatch
=
'openid_sreg_'
;
if
(
substr
(
$key
,
0
,
strlen
(
$keyMatch
))
!=
$keyMatch
)
{
if
(
substr
_compare
(
$key
,
$keyMatch
,
0
,
strlen
(
$keyMatch
))
)
{
continue
;
}
$key
=
substr
(
$key
,
strlen
(
$keyMatch
));
...
...
extensions/gii/generators/model/Generator.php
View file @
07f01bcf
...
...
@@ -478,7 +478,7 @@ class Generator extends \yii\gii\Generator
if
(
$this
->
isReservedKeyword
(
$this
->
modelClass
))
{
$this
->
addError
(
'modelClass'
,
'Class name cannot be a reserved PHP keyword.'
);
}
if
(
substr
(
$this
->
tableName
,
-
1
)
!==
'*'
&&
$this
->
modelClass
==
''
)
{
if
(
substr
_compare
(
$this
->
tableName
,
'*'
,
-
1
)
&&
$this
->
modelClass
==
''
)
{
$this
->
addError
(
'modelClass'
,
'Model Class cannot be blank if table name does not end with asterisk.'
);
}
}
...
...
extensions/gii/generators/module/Generator.php
View file @
07f01bcf
...
...
@@ -146,7 +146,7 @@ EOD;
if
(
strpos
(
$this
->
moduleClass
,
'\\'
)
===
false
||
Yii
::
getAlias
(
'@'
.
str_replace
(
'\\'
,
'/'
,
$this
->
moduleClass
),
false
)
===
false
)
{
$this
->
addError
(
'moduleClass'
,
'Module class must be properly namespaced.'
);
}
if
(
substr
(
$this
->
moduleClass
,
-
1
,
1
)
==
'\\'
)
{
if
(
substr
_compare
(
$this
->
moduleClass
,
'\\'
,
-
1
,
1
)
===
0
)
{
$this
->
addError
(
'moduleClass'
,
'Module class name must not be empty. Please enter a fully qualified class name. e.g. "app\\modules\\admin\\Module".'
);
}
}
...
...
extensions/sphinx/gii/model/Generator.php
View file @
07f01bcf
...
...
@@ -266,7 +266,7 @@ class Generator extends \yii\gii\Generator
if
(
$this
->
isReservedKeyword
(
$this
->
modelClass
))
{
$this
->
addError
(
'modelClass'
,
'Class name cannot be a reserved PHP keyword.'
);
}
if
(
substr
(
$this
->
indexName
,
-
1
)
!==
'*'
&&
$this
->
modelClass
==
''
)
{
if
(
substr
_compare
(
$this
->
indexName
,
'*'
,
-
1
)
&&
$this
->
modelClass
==
''
)
{
$this
->
addError
(
'modelClass'
,
'Model Class cannot be blank if table name does not end with asterisk.'
);
}
}
...
...
framework/console/controllers/MessageController.php
View file @
07f01bcf
...
...
@@ -333,7 +333,7 @@ class MessageController extends Controller
ksort
(
$translated
);
foreach
(
$translated
as
$message
=>
$translation
)
{
if
(
!
isset
(
$merged
[
$message
])
&&
!
isset
(
$todo
[
$message
])
&&
!
$removeUnused
)
{
if
(
substr
(
$translation
,
0
,
2
)
===
'@@'
&&
substr
(
$translation
,
-
2
)
===
'@@'
)
{
if
(
substr
_compare
(
$translation
,
'@@'
,
0
,
2
)
===
0
&&
substr_compare
(
$translation
,
'@@'
,
-
2
)
===
0
)
{
$todo
[
$message
]
=
$translation
;
}
else
{
$todo
[
$message
]
=
'@@'
.
$translation
.
'@@'
;
...
...
framework/grid/CheckboxColumn.php
View file @
07f01bcf
...
...
@@ -63,7 +63,7 @@ class CheckboxColumn extends Column
if
(
empty
(
$this
->
name
))
{
throw
new
InvalidConfigException
(
'The "name" property must be set.'
);
}
if
(
substr
(
$this
->
name
,
-
2
)
!==
'[]'
)
{
if
(
substr
_compare
(
$this
->
name
,
'[]'
,
-
2
)
)
{
$this
->
name
.=
'[]'
;
}
}
...
...
framework/helpers/BaseHtml.php
View file @
07f01bcf
...
...
@@ -803,7 +803,7 @@ class BaseHtml
$options
[
'name'
]
=
$name
;
if
(
isset
(
$options
[
'unselect'
]))
{
// add a hidden field so that if the list box has no option being selected, it still submits a value
if
(
substr
(
$name
,
-
2
)
===
'[]'
)
{
if
(
substr
_compare
(
$name
,
'[]'
,
-
2
)
===
0
)
{
$name
=
substr
(
$name
,
0
,
-
2
);
}
$hidden
=
static
::
hiddenInput
(
$name
,
$options
[
'unselect'
]);
...
...
framework/web/UrlManager.php
View file @
07f01bcf
...
...
@@ -238,7 +238,7 @@ class UrlManager extends Component
$suffix
=
(
string
)
$this
->
suffix
;
if
(
$suffix
!==
''
&&
$pathInfo
!==
''
)
{
$n
=
strlen
(
$this
->
suffix
);
if
(
substr
(
$pathInfo
,
-
$n
)
===
$this
->
suffix
)
{
if
(
substr
_compare
(
$pathInfo
,
$this
->
suffix
,
-
$n
)
===
0
)
{
$pathInfo
=
substr
(
$pathInfo
,
0
,
-
$n
);
if
(
$pathInfo
===
''
)
{
// suffix alone is not allowed
...
...
framework/web/UrlRule.php
View file @
07f01bcf
...
...
@@ -215,7 +215,7 @@ class UrlRule extends Object implements UrlRuleInterface
$suffix
=
(
string
)
(
$this
->
suffix
===
null
?
$manager
->
suffix
:
$this
->
suffix
);
if
(
$suffix
!==
''
&&
$pathInfo
!==
''
)
{
$n
=
strlen
(
$suffix
);
if
(
substr
(
$pathInfo
,
-
$n
)
===
$suffix
)
{
if
(
substr
_compare
(
$pathInfo
,
$suffix
,
-
$n
)
===
0
)
{
$pathInfo
=
substr
(
$pathInfo
,
0
,
-
$n
);
if
(
$pathInfo
===
''
)
{
// 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