Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparer.php Fails with special characters #88

Closed
joshwegener opened this issue Jan 20, 2017 · 19 comments
Closed

Comparer.php Fails with special characters #88

joshwegener opened this issue Jan 20, 2017 · 19 comments

Comments

@joshwegener
Copy link

Having issues when comparing special characters...

// file ./concrete/vendor/punic/punic/code/Comparer.php
   // .....
    public function compare($a, $b)
       // .....
       // failing when comparing "Latvia" and "St. Barthélemy"
       $result = $this->caseSensitive ? strnatcmp($a, $b) : strnatcasecmp($a, $b)
       // .....
@Remo
Copy link
Contributor

Remo commented Jan 20, 2017

can you please elaborate this a bit more? It works fine for me, not matter if iconv and/or Collator is missing. I'm running \Punic\Territory::getList('c') and the list is always properly sorted. Thanks

@joshwegener
Copy link
Author

You are welcome to come onto my server and have a look. I'm installing concrete5, and when it gets to \Punic\Territory::getList('c') it crashes. The server get's a internal server error 500.

I have tracked it down line by line, and the 2 values listed are the values being passed in and that is the line it's failing on.

@mlocati
Copy link
Member

mlocati commented Jan 21, 2017

I tested the line you reported and everything seems to work fine for any PHP version: see https://3v4l.org/Vt0Ji

What's your concrete5 version? What's your current language?

@joshwegener
Copy link
Author

joshwegener commented Jan 22, 2017 via email

@joshwegener
Copy link
Author

Here is the PHP info page: http://reds.whoisjoshw.com/info.php

And if you just go to the root, you can see the server 500 error that I'm getting on step 3.

@mlocati
Copy link
Member

mlocati commented Jan 23, 2017

It could be very useful to see the PHP error log, a simple "Error 500" page isn't a great help 😉

@joshwegener
Copy link
Author

There is no errors in the log.

@joshwegener
Copy link
Author

I would be happy to share the user details for ssh if you would like to check it out... I have spent hours trying to debug this.... JoshWegener@gmail.com - E-Mail me if you want the server details. It's just a VM, so I'm not worried about you messing it up...

@mlocati
Copy link
Member

mlocati commented Jan 23, 2017

Maybe there could be something in the apache error log...

@mlocati
Copy link
Member

mlocati commented Jan 23, 2017

I would be happy to share the user details for ssh if you would like to check it out... I have spent hours trying to debug this.... JoshWegener@gmail.com

I'm very curious... I'll write you an email

@joshwegener
Copy link
Author

I didn't see anything in the apache logs as well.

@joshwegener
Copy link
Author

Feel free to change anything in ~/reds.whoisjoshw.com for testing. And if you change that file where I noted above, you can see it is failing there... Just not sure why. I thought it was the é in "Barthélemy" causing some sort of issue; but when I test just that peace, it does appear to work... If you need a fresh copy of the code, just

cd /home/whoisjoshw/reds.whoisjoshw.com && rm -rf ./* && unzip ../concrete5-8.0.3.zip && mv concrete5-8.0.3/* ./ && rmdir concrete5-8.0.3/

@mlocati
Copy link
Member

mlocati commented Jan 23, 2017

  1. I tried to update Punic to the very latest version (as per #4699), without success.
  2. I tried to enable the concrete5 debug errors (with concrete/bin/concrete5 c5:config -g set concrete.debug.detail debug and concrete/bin/concrete5 c5:config -g set concrete.debug.display_errors true), but nothing changed.
  3. I checked the apache error log, but I found no error

@joshwegener
Copy link
Author

joshwegener commented Jan 23, 2017

I have no idea what is causing this error.... or the lack of an error... other then server 500

@mlocati
Copy link
Member

mlocati commented Jan 23, 2017

I also tried to manually enable the PHP error log by placing these lines here and there:

ini_set('display_errors', 1);
error_reporting(-1);
ini_set('error_log', '/path/application/files/php-errors.log');
ini_set('log_errors', 1);

but still no success

@mlocati
Copy link
Member

mlocati commented Jan 27, 2017

So, the problem was not with Punic, isn't it?

@joshwegener
Copy link
Author

It appears it had something to do with the cpanel server configuration and modules. I rebuild it with easy apache 4 and it fixed the issue.

@mlocati
Copy link
Member

mlocati commented Feb 3, 2017

@joshwegener This has been very hard to debug, but I finally solved the underlying problem... Yes, the source of the problem was Punic, that under very specific cases broke the execution.
See #89

@joshwegener
Copy link
Author

joshwegener commented Feb 3, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants