mirror of
https://github.com/processwire/processwire.git
synced 2025-08-13 10:15:28 +02:00
Various minor adjustments, typo and text fixes
This commit is contained in:
@@ -723,8 +723,10 @@ function wireBytesStr($bytes, $small = false, $options = array()) {
|
||||
$val = $bytes;
|
||||
if($small) {
|
||||
$label = $val > 0 ? __('B', __FILE__) : ''; // bytes
|
||||
} else if($val == 1) {
|
||||
$label = __('byte', __FILE__); // singular 1-byte
|
||||
} else {
|
||||
$label = __('bytes', __FILE__);
|
||||
$label = __('bytes', __FILE__); // plural 2+ bytes (or 0 bytes)
|
||||
}
|
||||
} else if($bytes < 1000000 || $type === 'k') {
|
||||
$val = $bytes / 1024;
|
||||
|
@@ -3239,7 +3239,7 @@ class Page extends WireData implements \Countable, WireMatchable {
|
||||
*/
|
||||
public function url($options = null) {
|
||||
if($options !== null) return $this->traversal()->urlOptions($this, $options);
|
||||
$url = rtrim($this->wire('config')->urls->root, "/") . $this->path();
|
||||
$url = rtrim($this->wire('config')->urls->root, '/') . $this->path();
|
||||
if($this->template->slashUrls === 0 && $this->settings['id'] > 1) $url = rtrim($url, '/');
|
||||
return $url;
|
||||
}
|
||||
|
@@ -993,7 +993,7 @@ class WireFileTools extends Wire {
|
||||
|
||||
// add .php extension if filename doesn't already have an extension
|
||||
if($options['autoExtension'] && !strrpos(basename($filename), '.')) {
|
||||
$filename .= "." . $options['autoExtension'];
|
||||
$filename .= '.' . $options['autoExtension'];
|
||||
}
|
||||
|
||||
if(strpos($filename, '..') !== false) {
|
||||
@@ -1034,10 +1034,15 @@ class WireFileTools extends Wire {
|
||||
// include the file
|
||||
TemplateFile::pushRenderStack($filename);
|
||||
$func = $options['func'];
|
||||
if($func == 'require') require($filename);
|
||||
else if($func == 'require_once') require_once($filename);
|
||||
else if($func == 'include_once') include_once($filename);
|
||||
else include($filename);
|
||||
if($func === 'require') {
|
||||
require($filename);
|
||||
} else if($func === 'require_once') {
|
||||
require_once($filename);
|
||||
} else if($func === 'include_once') {
|
||||
include_once($filename);
|
||||
} else {
|
||||
include($filename);
|
||||
}
|
||||
TemplateFile::popRenderStack();
|
||||
|
||||
return true;
|
||||
|
@@ -259,6 +259,7 @@ class WireLog extends Wire {
|
||||
*
|
||||
*/
|
||||
public function getFilename($name) {
|
||||
$name = strtolower($name);
|
||||
if($name !== $this->wire('sanitizer')->pageName($name)) {
|
||||
throw new WireException("Log name must contain only [-_.a-z0-9] with no extension");
|
||||
}
|
||||
|
Reference in New Issue
Block a user