Index: core/kernel/db/dblist.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/kernel/db/dblist.php (revision 15716)
+++ core/kernel/db/dblist.php (revision )
@@ -511,10 +511,10 @@
$this->Records = $this->Conn->Query($sql);
if (!$this->Records && ($this->Page > 1)) {
- // no records & page > 1, try to reset to 1st page (works only when list in not counted before)
- $this->Application->StoreVar($this->getPrefixSpecial() . '_Page', 1, true);
- $this->SetPage(1);
- $this->Query($force);
+ // no records & page > 1, show 404 page
+ trigger_error('Unknown page ' . $this->Page . ' in ' . $this->getPrefixSpecial() . ' list, leading to "404 Not Found"', E_USER_NOTICE);
+
+ $this->Application->UrlManager->show404();
}
$this->SelectedCount = count($this->Records);
\ No newline at end of file
Index: core/kernel/managers/url_manager.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/kernel/managers/url_manager.php (revision 15716)
+++ core/kernel/managers/url_manager.php (revision )
@@ -484,4 +484,24 @@
return $vars;
}
+
+ /**
+ * Show 404 page and exit
+ *
+ * @return void
+ * @access public
+ */
+ public function show404()
+ {
+ $vars = $this->prepare404();
+
+ foreach ($vars as $var_name => $var_value) {
+ $this->Application->SetVar($var_name, $var_value);
+ }
+
+ // ensure parser is available (e.g. 404 page requested from event)
+ $this->Application->QuickRun();
+ $this->Application->Done();
+ exit;
+ }
}
\ No newline at end of file
Index: core/kernel/db/db_event_handler.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/kernel/db/db_event_handler.php (revision 15716)
+++ core/kernel/db/db_event_handler.php (revision )
@@ -539,16 +539,7 @@
trigger_error('ItemLoad Permission Failed for prefix [' . $event->getPrefixSpecial() . '] in checkItemStatus, leading to "404 Not Found"', E_USER_NOTICE);
- $vars = $this->Application->UrlManager->prepare404();
-
- foreach ($vars as $var_name => $var_value) {
- $this->Application->SetVar($var_name, $var_value);
- }
-
- // in case if missing item is recalled first from event (not from template)
- $this->Application->QuickRun();
- $this->Application->Done();
- exit;
+ $this->Application->UrlManager->show404();
}
/**
\ No newline at end of file
Index: core/kernel/application.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/kernel/application.php (revision 15716)
+++ core/kernel/application.php (revision )
@@ -1105,8 +1105,12 @@
*/
public function QuickRun()
{
+ // discard any half-parsed content
+ ob_clean();
+
+ // replace current page content with 404
$this->InitParser();
- $this->HTML = $this->ParseBlock(Array ('name' => $this->GetVar('t')));
+ $this->HTML = $this->Parser->Run($this->GetVar('t'));
}
/**
\ No newline at end of file