| Anonymous | Login | Signup for a new account | 02-09-10 21:54 GMT | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Print ] | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |
| 0008898 | phplist | RSS | public | 11-01-07 06:12 | 18-02-08 14:08 | |
| Reporter | danatang | |||||
| Priority | normal | Severity | minor | Reproducibility | always | |
| Status | resolved | Resolution | fixed | |||
| Platform | OS | OS Version | ||||
| Product Version | 2.10.4 | |||||
| Target Version | 2.10.7 | Fixed in Version | 2.10.5 | |||
| Summary | 0008898: getrss bug for chinese rssitem title in UTF-8 encoding | |||||
| Description | I found a bug in getrss.php. If the length of a rss item title is longer than 100 or the item title is in double byte format(such as chinese), when I click the get rss link, the same items will be added repeatedly. The original code is as below: /////////////// Sql_Query(sprintf('select * from %s where title = "%s" and link = "%s"', tables["rssitem"],addslashes(substr($item["title"],0,100)),addslashes(substr($item["link"],0,100)))); /////////////// And I fix as below: Sql_Query(sprintf("select * from %s where title = '%s' and link = '%s'", $tables["rssitem"],addslashes($item["title"]),addslashes($item["link"]))); Hope it is helpful to all. | |||||
| Tags | No tags attached. | |||||
| Attached Files | ||||||
Relationships |
||||||
|
||||||
Notes |
|
|
(0030247) bas (developer) 08-08-07 19:01 |
I don't understand how this could fix the problem, since the databasefield is a varchar(100). I do believe it should be rewritten as substr(addslashes($item["title"]),0,100) though. Couold you please try and confirm this? |
|
(0030260) danatang (reporter) 09-08-07 02:47 |
Dear bas, Thanks. I have tried and I am sure the substr($item["title"],0,100) will cut UTF-8 encoding string. Because my mysql db is UTF-8(multibyte) encoding, so the strlen() of the title (varchar(100) data field) will exceed 100, it counts byte. I suggest use mb_substr() instead of substr() for multibyte encoding. Otherwise, just do not set length in substr(). |
|
(0031063) bas (developer) 27-08-07 13:03 |
suggestion adopted |
| Copyright © 2000 - 2010 MantisBT Group |