Mssql - fix escape() and add support for unicode chars#13585
Mssql - fix escape() and add support for unicode chars#13585wilsonge merged 3 commits intojoomla:stagingfrom
Conversation
9ab3048 to
b35f3ce
Compare
|
I have different results for step 7 and step 12: Step 7: Step12: The rest works as described. |
|
This is OK, you have in total 67 articles, I had 75 articles. |
|
wait a moment |
|
You talk about Result 2: "67" where I got 75? Right? |
|
No, I talk about Result 1. My results a different then yours. |
|
Last time I added unicode support, it may change that. I'm checking it. |
|
Do you have title of article "TEST 1 - ale[x]" <- brackets are important to test it. |
|
I do have the brackets in the title. |
|
which database do you use: local SQL Server or Azure? If SQL server then what version? |
|
SQL Server 2008 R2 |
|
I have rebased PR and improved a test instruction. I based on https://msdn.microsoft.com/library/ms179859.aspx where I will wait for next test. May it resolve something. |
|
It would be a good idea to rebase this now that AppVeyor is CI testing our unit test suite with MSSQL |
|
@csthomas can you comment on the unit test failure on the Framework version? |
|
For mssql |
|
Now AppVeyor is happy:) |
| $result = str_replace('_', '[_]', $result); | ||
| // Escape special chars | ||
| $result = str_replace( | ||
| array('[', '_', '%'), |
There was a problem hiding this comment.
do we also need ] to be escaped?
array('[', ']', '_', '%'),
array('[[]', '[]]''[_]', '[%]'),There was a problem hiding this comment.
No.
According to doc https://msdn.microsoft.com/library/ms179859.aspx#Anchor_7
and my own tests.
There was a problem hiding this comment.
Thanks for the clarification
photodude
left a comment
There was a problem hiding this comment.
Looks good on code review
|
@alikon You can test and confirm or not waader results? |
|
I have tested this item ✅ successfully on 8d12824 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13585. |
|
As I have no sample data installed the difference most likely is the runtime environment. I will dig into it when I have more time. |
|
Given this only affects SQLServer I'm going to merge this with the code review and the one good test |
|
Thanks now I can go forward and complete next one #13262 as I mentioned. |

Pull Request for better version of #13534
Summary of Changes
$db->escape()$db->quote()add prefix N, means instead column = 'text' there will be column = N'text' which add support for unicode, international chars (ex. Polish chars ąęćółńżź)Testing Instructions
Meta Descriptionfield to (add some national chars like ąęśżźół):Titleto "TEST 1 - ale[x]"Meta Descriptionfield is not saved properly (new line has been removed, national chars disapears).templates/protostar/index.php</body>):or similar (number bigger than 0) - sample testing data installed
Meta Descriptionis saved OK.Content Rightsfield (json column) to:Note: If you added above text before applying patch you get Json error on joomla with applied patch. Before adding patch please reset that field.
11. Save and check whether content rights is correct.
12. Go to front page and check results:
Explanation for tests:
escapedoes not work if correct way.Content Rights- is stored, encoded to json. This test check whether json which contains backslashes or quotes works correctly.Documentation Changes Required
N/A