Last modified: 2011-10-23 13:33:00 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 T33894, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31894 - nested php comments in DatabaseMysql.php cause error on debian 5 machine
nested php comments in DatabaseMysql.php cause error on debian 5 machine
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.20.x
All Linux
: Unprioritized critical (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-22 23:11 UTC by Gregor Hagedorn
Modified: 2011-10-23 13:33 UTC (History)
2 users (show)

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


Attachments

Description Gregor Hagedorn 2011-10-22 23:11:15 UTC
Introduced by reedy on Sept. 16. in r97301 and still present (tested up to r100519; last working version is r97300) we experience:

Parse error: syntax error, unexpected '*', expecting T_FUNCTION in /usr/share/mediawikistaging/phase3/includes/db/DatabaseMysql.php on line 388

Line 388 is "**/" above "function strencode( $s ) {" and is a nested php comment; the inner comment was introduced in r97301.

Probably easy to fix, but out of curiosity: Why do not others experience this in the last 5 weeks? Does this depend on php versions? Our is http://biowikifarm.net/test/Special:Version - a standard Debian 5.
Comment 1 Sam Reed (reedy) 2011-10-22 23:54:47 UTC
Works fine for me on 5.3.2 and 5.2.4

It seems like you had local modifications, and then svn upping has introduced something like a merge conflict

Not my fault

See below

Lines 368-298

	/**
	 * @param $db
	 * @return bool
	 */
	function selectDB( $db ) {
		$this->mDBname = $db;
		return mysql_select_db( $db, $this->mConn );
	}

	/**
	 * @param $s string
	 *
	 * @return string
	 */
	function strencode( $s ) {
		$sQuoted = mysql_real_escape_string( $s, $this->mConn );

		if($sQuoted === false) {
			$this->ping();
			$sQuoted = mysql_real_escape_string( $s, $this->mConn );
		}
		return $sQuoted;
	}

	/**
	 * MySQL uses `backticks` for identifier quoting instead of the sql standard "double quotes".
	 *
	 * @param $s string
	 *
	 * @return string
	 */
	public function addIdentifierQuotes( $s ) {
		return "`" . $this->strencode( $s ) . "`";
	}





reedy@ubuntu64-web-esxi:~$ php --version
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/sqlite.so' - /usr/lib/php5/20090626/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.3.6-13ubuntu3.2 with Suhosin-Patch (cli) (built: Oct 13 2011 23:09:42)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
    with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
reedy@ubuntu64-web-esxi:~$ wget http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/db/DatabaseMysql.php?revision=97376&view=co
[1] 12782
--2011-10-23 00:52:28--  http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/db/DatabaseMysql.php?revision=97376
Resolving svn.wikimedia.org... 208.80.152.147
Connecting to svn.wikimedia.org|208.80.152.147|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: `DatabaseMysql.php?revision=97376'

    [<=>                                                                                                                            ] 0           --.-K/s              DatabaseMysql.php: command not found
    [  <=>                                                                                                                          ] 22,076      71.2K/s   in 0.3s

2011-10-23 00:52:29 (71.2 KB/s) - `DatabaseMysql.php?revision=97376' saved [22076]


[1]+  Done                    wget http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/db/DatabaseMysql.php?revision=97376
reedy@ubuntu64-web-esxi:~$ ls
DatabaseMysql.php?revision=97376  mbox  mediawiki  test.php
reedy@ubuntu64-web-esxi:~$ php -l DatabaseMysql.php\?revision\=97376
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/sqlite.so' - /usr/lib/php5/20090626/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
No syntax errors detected in DatabaseMysql.php?revision=97376





reedy@fenari:~$ php --version
PHP 5.2.4-2ubuntu5.12wm1 with Suhosin-Patch 0.9.6.2 (cli) (built: Sep 23 2010 20:36:55)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
reedy@fenari:~$ wget http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/db/DatabaseMysql.php?revision=97376&view=co
[1] 27039
reedy@fenari:~$ --23:53:21--  http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/db/DatabaseMysql.php?revision=97376
           => `DatabaseMysql.php?revision=97376'
Resolving svn.wikimedia.org... 208.80.152.147
Connecting to svn.wikimedia.org|208.80.152.147|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]

    [ <=>                                                                                                                         ] 22,076        --.--K/s

23:53:22 (430.63 MB/s) - `DatabaseMysql.php?revision=97376' saved [22076]


[1]+  Done                    wget http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/db/DatabaseMysql.php?revision=97376
reedy@fenari:~$ php -l DatabaseMysql.php\?revision\=97376
No syntax errors detected in DatabaseMysql.php?revision=97376
Comment 2 Gregor Hagedorn 2011-10-23 00:17:48 UTC
I confirm: not your fault! Deleting the file and checking out again did solve the problem. However, I did repeatedly switch between 97300 and 97301 with svn and the error was fully reproducable and did not report a conflict, but ... My apologies and thanks!
Comment 3 Bernhard Zelazny 2011-10-23 13:33:00 UTC
http://biowikifarm.net/test (now with MediaWiki version 1.19, r100522 and MassEditRegex version r4) still produces a white screen for all edit attempts, although the results from the preview option look perfect.

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


Navigation
Links