Quantcast
Channel: Distractions » wordpress
Viewing all articles
Browse latest Browse all 5

PHP: Pain, Hate, Programming

$
0
0

An apparently recent upgrade of PHP on this server lead me to update a mediawiki and debug Tom Sella‘s venerable post directionality wordpress plugin, which was working fine on my box (PHP 5.3.3-1ubuntu9.3) but not on the server (PHP 5.3.6-8), apparently because \w in regular expressions now matches Hebrew characters. My fix was to replace this line:

$c_eng = $this->count_it($text, '/\w+/u');

with this one:

$c_eng = $this->count_it($text, '/[\p{Latin}\d\_]+/u');

Not sure if it will work everywhere, but seems to fix the problem here.

OK, so now I can start doing $WORK…


Viewing all articles
Browse latest Browse all 5

Trending Articles