/** * Throws a 404 message. * * @param string $msg Message string * @return void */ public function decodeSpURL_throw404($msg) { // Log error if (!$this->extConf['init']['disableErrorLog']) { $hash = $this->apiWrapper->md5int($this->speakingURIpath_procValue); $rootpage_id = intval($this->extConf['pagePath']['rootpage_id']); $cond = 'url_hash=' . intval($hash) . ' AND rootpage_id=' . $rootpage_id; $fields_values = array('url_hash' => $hash, 'url' => $this->speakingURIpath_procValue, 'error' => $msg, 'counter' => 1, 'tstamp' => time(), 'cr_date' => time(), 'rootpage_id' => $rootpage_id, 'last_referer' => $this->apiWrapper->getIndpEnv('HTTP_REFERER')); if ($this->useMySQLExtendedSyntax) { /** @noinspection PhpUndefinedMethodInspection */ $query = $GLOBALS['TYPO3_DB']->INSERTquery('tx_realurl_errorlog', $fields_values); /** @noinspection PhpUndefinedMethodInspection */ $query .= ' ON DUPLICATE KEY UPDATE ' . 'error=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($msg, 'tx_realurl_errorlog') . ',' . 'counter=counter+1,' . 'tstamp=' . $fields_values['tstamp'] . ',' . 'last_referer=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->apiWrapper->getIndpEnv('HTTP_REFERER'), 'tx_realurl_errorlog'); /** @noinspection PhpUndefinedMethodInspection */ $GLOBALS['TYPO3_DB']->sql_query($query); } else { /** @noinspection PhpUndefinedMethodInspection */ $GLOBALS['TYPO3_DB']->sql_query('START TRANSACTION'); /** @noinspection PhpUndefinedMethodInspection */ list($error_row) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('counter', 'tx_realurl_errorlog', $cond); if (count($error_row)) { /** @noinspection PhpUndefinedMethodInspection */ $fields_values = array('error' => $msg, 'counter' => $error_row['counter'] + 1, 'tstamp' => time(), 'last_referer' => $this->apiWrapper->getIndpEnv('HTTP_REFERER')); /** @noinspection PhpUndefinedMethodInspection */ $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_realurl_errorlog', $cond, $fields_values); } else { /** @noinspection PhpUndefinedMethodInspection */ $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_realurl_errorlog', $fields_values); } /** @noinspection PhpUndefinedMethodInspection */ $GLOBALS['TYPO3_DB']->sql_query('COMMIT'); } } // Call handler $this->pObj->pageNotFoundAndExit($msg); }