1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-15 11:14:12 +02:00
This commit is contained in:
Ryan Cramer
2020-04-15 16:28:48 -04:00
parent 29fbf0b2f7
commit ed0f573432

View File

@@ -164,7 +164,11 @@ class PagePathHistory extends WireData implements Module, ConfigurableModule {
$database = $this->wire('database');
$table = self::dbTableName;
$path = $this->wire('sanitizer')->pagePathName('/' . trim($path, '/'), Sanitizer::toAscii);
if($this->wire('pages')->count("path=$path")) return false;
$selector = "path=$path";
if($this->wire('modules')->isInstalled('PagePaths')) $selector .= ", id!=$page->id";
if($this->wire('pages')->count($selector)) return false;
$language = $this->getLanguage($language);
$sql = "INSERT INTO $table SET path=:path, pages_id=:pages_id, created=NOW()";