change explode's limit parameter based on known variable content
This commit is contained in:
parent
b3cc270450
commit
cd24fb86a8
@ -66,7 +66,7 @@ class ControllerResolver extends BaseControllerResolver
|
||||
}
|
||||
}
|
||||
|
||||
list($class, $method) = explode('::', $controller, 3);
|
||||
list($class, $method) = explode('::', $controller, 2);
|
||||
|
||||
if (!class_exists($class)) {
|
||||
throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class));
|
||||
|
@ -513,7 +513,7 @@ class FrameworkExtension extends Extension
|
||||
})->in($dirs);
|
||||
foreach ($finder as $file) {
|
||||
// filename is domain.locale.format
|
||||
list($domain, $locale, $format) = explode('.', $file->getBasename(), 4);
|
||||
list($domain, $locale, $format) = explode('.', $file->getBasename(), 3);
|
||||
|
||||
$translator->addMethodCall('addResource', array($format, (string) $file, $locale, $domain));
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ class CodeHelper extends Helper
|
||||
public function abbrMethod($method)
|
||||
{
|
||||
if (false !== strpos($method, '::')) {
|
||||
list($class, $method) = explode('::', $method, 3);
|
||||
list($class, $method) = explode('::', $method, 2);
|
||||
$result = sprintf("%s::%s()", $this->abbrClass($class), $method);
|
||||
} else if ('Closure' === $method) {
|
||||
$result = sprintf("<abbr title=\"%s\">%s</abbr>", $method, $method);
|
||||
|
@ -28,7 +28,7 @@ class StubTemplateNameParser implements TemplateNameParserInterface
|
||||
|
||||
public function parse($name)
|
||||
{
|
||||
list($bundle, $controller, $template) = explode(':', $name, 4);
|
||||
list($bundle, $controller, $template) = explode(':', $name, 3);
|
||||
|
||||
if ($template[0] == '_') {
|
||||
$path = $this->rootTheme.'/Custom/'.$template;
|
||||
|
@ -266,7 +266,7 @@ class FunctionNode implements NodeInterface
|
||||
return array(0, intval((string) $s));
|
||||
}
|
||||
|
||||
list($a, $b) = explode('n', $s, 3);
|
||||
list($a, $b) = explode('n', $s);
|
||||
if (!$a) {
|
||||
$a = 1;
|
||||
} elseif ('-' == $a || '+' == $a) {
|
||||
|
@ -135,7 +135,7 @@ class RequestMatcher implements RequestMatcherInterface
|
||||
protected function checkIp4($requestIp, $ip)
|
||||
{
|
||||
if (false !== strpos($ip, '/')) {
|
||||
list($address, $netmask) = explode('/', $ip, 3);
|
||||
list($address, $netmask) = explode('/', $ip, 2);
|
||||
|
||||
if ($netmask < 1 || $netmask > 32) {
|
||||
return false;
|
||||
@ -158,7 +158,7 @@ class RequestMatcher implements RequestMatcherInterface
|
||||
throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".');
|
||||
}
|
||||
|
||||
list($address, $netmask) = explode('/', $ip, 3);
|
||||
list($address, $netmask) = explode('/', $ip, 2);
|
||||
|
||||
$bytes_addr = unpack("n*", inet_pton($address));
|
||||
$bytes_test = unpack("n*", inet_pton($requestIp));
|
||||
|
@ -145,7 +145,7 @@ class ControllerResolver implements ControllerResolverInterface
|
||||
throw new \InvalidArgumentException(sprintf('Unable to find controller "%s".', $controller));
|
||||
}
|
||||
|
||||
list($class, $method) = explode('::', $controller, 3);
|
||||
list($class, $method) = explode('::', $controller, 2);
|
||||
|
||||
if (!class_exists($class)) {
|
||||
throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class));
|
||||
|
@ -144,7 +144,7 @@ class DigestData
|
||||
$parts = preg_split('/, /', $header);
|
||||
$this->elements = array();
|
||||
foreach ($parts as $part) {
|
||||
list($key, $value) = explode('=', $part, 3);
|
||||
list($key, $value) = explode('=', $part);
|
||||
$this->elements[$key] = '"' === $value[0] ? substr($value, 1, -1) : $value;
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ abstract class FileLoader implements LoaderInterface
|
||||
if (strpos($name, '\\') !== false && class_exists($name)) {
|
||||
$className = (string) $name;
|
||||
} else if (strpos($name, ':') !== false) {
|
||||
list($prefix, $className) = explode(':', $name, 3);
|
||||
list($prefix, $className) = explode(':', $name, 2);
|
||||
|
||||
if (!isset($this->namespaces[$prefix])) {
|
||||
throw new MappingException(sprintf('Undefined namespace prefix "%s"', $prefix));
|
||||
|
Reference in New Issue
Block a user