Last modified: 2011-07-29 19:27:46 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 T31763, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29763 - Some of the byte data on postgres doesn't get escaped correctly while doing SMW ask
Some of the byte data on postgres doesn't get escaped correctly while doing S...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Unprioritized critical (vote)
: ---
Assigned To: Markus Krötzsch
:
: 30090 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-07 20:55 UTC by Alan Fang
Modified: 2011-07-29 19:27 UTC (History)
2 users (show)

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


Attachments

Description Alan Fang 2011-07-07 20:55:11 UTC
Hi, I am having a major rendering issues with our website. The statements has returned to use with some un-escaped data. For example: newline -> \012,  tab -> \001. The problem is the range of the hex number has been limited to 13-128. All the other octal code will not be translated correctly.

I have been found out that the page_content inside the database uses UTF8 text type and the value_blob in smw_text2 table uses bytea. It seems to be that the database is unable to escape my property value and turn it back into utf8 while I am retrieving it from the database.

Can some one help me to enable the escape in postgre? Or is there a filter I can apply in SMW code that convert those octal back into binary? 

Thanks, here are the version of software I have install in the server:

Mediawiki: 	     1.15.5-1~bpo50+1
PostgreSQL:          8.3.13
PHP:                 5.2.6-1+lenny10 (apache2handler)
Semantic MediaWiki:  1.5.6
Comment 1 Alan Fang 2011-07-08 15:53:22 UTC
The problem has been fix by adding an escape sequence at the print out function.
It turns out that the postgres will not do the escape automatically and you have to use pg_unescape_bytea() function to do it yourself. The fix is:
  1.open the SMW_QueryPrinter.php contain in the semantic mediawiki includes folder
  
  2.in getResult() function(line 129), add the following line at the end:
       
  $result = pg_unescape_bytea($result);
  
  
  for more information, please refer to http://php.net/manual/en/function.pg-unescape-bytea.php
Comment 2 Jeroen De Dauw 2011-07-27 22:42:09 UTC
Patch applied in r93327. Sorry for the wait, and thanks for the fix!
Comment 3 Brandon Plewe 2011-07-29 19:27:46 UTC
*** Bug 30090 has been marked as a duplicate of this bug. ***

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


Navigation
Links