Formatting

This commit is contained in:
bzick
2015-01-08 12:44:38 +03:00
parent 5e42892979
commit 16d5f337c0
2 changed files with 5 additions and 7 deletions

View File

@@ -107,11 +107,9 @@ class Modifier
if (preg_match('#^(.{' . $length . '}).*?(.{' . $length . '})?$#usS', $string, $match)) { if (preg_match('#^(.{' . $length . '}).*?(.{' . $length . '})?$#usS', $string, $match)) {
if (count($match) == 3) { if (count($match) == 3) {
if ($by_words) { if ($by_words) {
return preg_replace('#\s.*$#usS', "", $match[1]) . $etc . preg_replace( return preg_replace('#\s.*$#usS', "", $match[1]) .
'#.*\s#usS', $etc .
"", preg_replace('#.*\s#usS', "", $match[2]);
$match[2]
);
} else { } else {
return $match[1] . $etc . $match[2]; return $match[1] . $etc . $match[2];
} }

View File

@@ -146,8 +146,8 @@ class Provider implements ProviderInterface
*/ */
protected function _getTemplatePath($tpl) protected function _getTemplatePath($tpl)
{ {
$path = realpath($this->_path . "/" . $tpl);
if (($path = realpath($this->_path . "/" . $tpl)) && strpos($path, $this->_path) === 0) { if ($path && strpos($path, $this->_path) === 0) {
return $path; return $path;
} else { } else {
throw new \RuntimeException("Template $tpl not found"); throw new \RuntimeException("Template $tpl not found");