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 (count($match) == 3) {
if ($by_words) {
return preg_replace('#\s.*$#usS', "", $match[1]) . $etc . preg_replace(
'#.*\s#usS',
"",
$match[2]
);
return preg_replace('#\s.*$#usS', "", $match[1]) .
$etc .
preg_replace('#.*\s#usS', "", $match[2]);
} else {
return $match[1] . $etc . $match[2];
}

View File

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