Last modified: 2006-06-04 01:50:59 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 4890 - Misleading error message in SyntaxHighlight rev. 1.1 as of June, 2005
Misleading error message in SyntaxHighlight rev. 1.1 as of June, 2005
Product: MediaWiki extensions
Classification: Unclassified
Highlight (Other open bugs)
PC Windows XP
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2006-02-06 11:36 UTC by kexo
Modified: 2006-06-04 01:50 UTC (History)
0 users

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


Description kexo 2006-02-06 11:36:30 UTC
When an internal error occurs in GeSHi, SyntaxHighlight.php reports this in 
exactly the same way as SyntaxHighlight.php reports bad usage: "You need to 
specify a language ..."
This misleads users into believing they did something wrong in specifying a 
language, while in reality the error lies somewhere else, deep down in GeSHi.

Possible remedy: Modify SyntaxHighlight so that the usage message (syntaxHelp 
with no parameter as called from syntaxHook) is distinguished from error 
messages (syntaxHelp with one parameter as called from syntaxFormat).
Comment 1 Brion Vibber 2006-02-06 21:06:22 UTC
Hopefully an internal error should never happen. ;)

What's an example of an error message return? How would this be handled?
Comment 2 kexo 2006-02-07 13:26:40 UTC
Example steps to reproduce behavior (the language java serves as an 
example here - this works with any language):
1. In Mediawiki, view or preview a page containing the content '<source 
lang="java">{ System.out.println("Test"); }</source>'. Text is 
successfully highlighted using GeSHi.
2. On the file system level, deny everybody read access to the 
file /extensions/geshi/geshi/java.php (including the account used by the 
web server and by PHP).
3. In Mediawiki, reload or preview again the page. The page now contains 
the misleading error message "You need to specify a language ..."
(4. Undo step 2 to regain functionality.)

Diagnosis: GeSHi passes a valid error message to SyntaxHighlight.php: In 
SyntaxHighlight.php, in method syntaxFormat, the error message is 
retrieved (call to $geshi->error()) and SyntaxHighlight.php stores this 
message in variable $error. Then, SyntaxHighlight.php passes the value of 
the variable $error to the function syntaxHelp, but the latter method 
fails to output the value of this (optional) parameter or to do anything 
with it.
Comment 3 Brion Vibber 2006-06-04 01:50:59 UTC
If you have to break your own server, well... Hardly seems 
like an issue?

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