1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-15 19:24:28 +02:00

Bump version to 3.0.127 plus some other minor updates

This commit is contained in:
Ryan Cramer
2019-03-01 15:38:48 -05:00
parent ba8202d869
commit 906640ecb7
5 changed files with 40 additions and 4 deletions

View File

@@ -147,6 +147,10 @@ class PagesLoader extends Wire {
foreach($a as $k => $v) $a[$k] = (int) $v;
$value = $this->getById($a, $loadOptions);
}
} else if(!Selectors::stringHasOperator($selector)) {
if($this->wire('sanitizer')->pageNameUTF8($selector) === $selector) {
$selector = "name=$selector";
}
}
}
}

View File

@@ -44,7 +44,7 @@ class ProcessWire extends Wire {
* Reversion revision number
*
*/
const versionRevision = 126;
const versionRevision = 127;
/**
* Version suffix string (when applicable)

View File

@@ -8,8 +8,8 @@
*
* @property array $requirements Array of requirements (See require* constants)
* @property array $requirementsLabels Text labels used for requirements
* @property string $complexifyBanMode Complexify ban mode (default='loose')
* @property float $complexifyFactor Complexify factor
* @property string $complexifyBanMode Complexify ban mode, 'loose' or 'strict' (default='loose')
* @property float $complexifyFactor Complexify factor, lower numbers enable simpler passwords (default=0.7)
* @property int $requireOld Require previous password? 0=Auto, 1=Yes, -1=No, Default=0 (Auto)
* @property bool $showPass Allow password to be rendered in renderValue and/or re-populated in form?
* @property string $defaultLabel Default label for field (default='Set Password'). Used when no 'label' has been set.

View File

@@ -358,6 +358,24 @@ class Languages extends PagesType {
return true;
}
/**
* Get the current language or optionally a specific named language
*
* - This method is not entirely necessary but is here to accompany the setLanguage() method for syntax convenience.
* - If you specify a `$name` argument, this method works the same as the `$languages->get($name)` method.
* - If you call with no arguments, it returns the current user language, same as `$user->language`, but using this
* method may be preferable in some contexts, depending on how your IDE understands API calls.
*
* @param string $name Specify language name (or ID) to get a specific language, or omit to get current language
* @return Language|NullPage|null
* @since 3.0.127
*
*/
public function getLanguage($name = '') {
if($name !== '') return is_object($name) && $name instanceof Language ? $name : $this->get($name);
return $this->wire('user')->language;
}
/**
* Undo a previous setLanguage() call, restoring the previous user language
*
@@ -754,7 +772,7 @@ class Languages extends PagesType {
}
$table = $matches[1];
$col = $matches[2];
// $col = $matches[2];
$languageID = (int) $matches[3];
foreach($this->wire('languages') as $language) {

View File

@@ -386,6 +386,20 @@ class ProcessPageView extends Process {
}
}
return $page;
} else {
// check for globally unique page which can redirect
$trit = trim($it, '/');
$spit = $this->wire('sanitizer')->pageNameUTF8($trit);
if($trit === $spit) {
// one segment off root
$spit = $this->wire('sanitizer')->selectorValue($spit);
$page = $this->wire('pages')->get("name=$spit, status=" . Page::statusUnique);
if($page->id && $page->viewable()) {
$this->redirectURL = $page->url;
} else {
$page = null;
}
}
}
$this->requestURL = $it;