mirror of
https://github.com/processwire/processwire.git
synced 2025-08-08 07:47:00 +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");
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ if(!defined("PROCESSWIRE")) die();
|
||||
* Note that if your site may be accessed at either domain.com OR www.domain.com, then you'll
|
||||
* want to include entries for both, pointing to the same /site-domain/ directory.
|
||||
*
|
||||
* Each /site/ dir has it's own /site/config.php file that should be pointing to a separate
|
||||
* Each /site/ dir has its own /site/config.php file that should be pointing to a separate
|
||||
* database. You shouldn't have two different /site/ dirs sharing the same database.
|
||||
*
|
||||
*/
|
||||
|
@@ -138,7 +138,7 @@ class InputfieldDatetimeSelect extends InputfieldDatetimeType {
|
||||
|
||||
$attrs = $this->inputfield->getAttributes();
|
||||
$attrs['type'] = 'hidden';
|
||||
$attrs['value'] = date(InputfieldDatetime::defaultDateInputFormat . ' ' . InputfieldDatetime::defaultTimeInputFormat, $value);
|
||||
if($value) $attrs['value'] = date(InputfieldDatetime::defaultDateInputFormat . ' ' . InputfieldDatetime::defaultTimeInputFormat, $value);
|
||||
unset($attrs['size'], $attrs['placeholder'], $attrs['class'], $attrs['required']);
|
||||
$attrs['class'] = 'InputfieldDatetimeValue';
|
||||
$attrStr = $this->inputfield->getAttributesString($attrs);
|
||||
|
Reference in New Issue
Block a user