Last modified: 2008-03-22 00:09:05 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T8892, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 6892 - Database error + PHP Undefined index notice on trackback.php on bad input + E_ALL
Database error + PHP Undefined index notice on trackback.php on bad input + E...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.8.x
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 6891 (view as bug list)
Depends on: 7147
Blocks:
  Show dependency treegraph
 
Reported: 2006-08-01 07:37 UTC by Nick Jenkins
Modified: 2008-03-22 00:09 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Nick Jenkins 2006-08-01 07:37:31 UTC
CURL command:
============================
curl --silent --include \
 -F 'url'='title'\
 -F 'blog_name'='80'\
 -F 'article'='Main Page'\
 -F 'excerpt'='"'\
 'localhost/wiki/trackback.php'
============================

LocalSettings.php includes this: 
============================
$wgUseTrackbacks = true;
error_reporting (E_ALL); 
$wgShowSQLErrors = true;
============================
(i.e. stricter error reporting, trackbacks usage enabled, and show details of
failed SQL queries).

HTML output contains:
============================
<br />
<b>Notice</b>:  Undefined index:  title in
<b>/var/www/hosts/mediawiki/phase3/trackback.php</b> on line <b>46</b><br />
<html>
                <head>
                <title>Database error</title>
                </head>
                <body>
                <h1><img src='/wiki/skins/common/images/wiki.png'
style='float:left;margin-right:1em' alt=''>Database error</h1>
                A database query syntax error has occurred.
This may indicate a bug in the software.
The last attempted database query was:
<blockquote><tt>INSERT  INTO `trackbacks`
(tb_page,tb_title,tb_url,tb_ex,tb_name) VALUES
('1',NULL,'title','&amp;#0000034;','80')</tt></blockquote>
from within function "<tt>Database::insert</tt>".
MySQL returned error "<tt>1048: Column 'tb_title' cannot be null
(localhost)</tt>".</body></html>
============================
Comment 1 Kkkdc @jawiki 2006-08-28 09:54:14 UTC
*** Bug 6891 has been marked as a duplicate of this bug. ***
Comment 2 Kkkdc @jawiki 2006-08-28 09:58:58 UTC
I expect replace "(untitled)" with wfMsg().

Index: trackback.php
===================================================================
--- trackback.php	(rev. 16138)
+++ trackback.php	(copied)
@@ -43,8 +43,8 @@
 
 $dbw =& wfGetDB(DB_MASTER);
 
-$tbtitle = $_POST['title'];
-$tbex = $_POST['excerpt'];
+$tbtitle = isset($_POST['title']) ? $_POST['title'] : "(untitled)";
+$tbex = isset($_POST['excerpt']) ? $_POST['excerpt'] : "";
 $tburl = $_POST['url'];
 $tbname = $_POST['blog_name'];
 $tbarticle = $_REQUEST['article'];
 $tbname = $_POST['blog_name'];
 $tbarticle = $_REQUEST['article'];
Comment 3 Brion Vibber 2008-03-22 00:09:05 UTC
Fixed in r32318

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links