As of PHP 5.3.0, the POSIX Regex extension is deprecated. There are a number of differences between POSIX regex and PCRE regex.

We need to switch from POSIX to PCRE. See PHP: Differences from POSIX regex - Manual for details.

CommentFileSizeAuthor
#5 1543906-5-split.patch912 bytesmgifford
#2 1543906-2-split.patch932 bytesjneubert

Comments

colan’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta1
jneubert’s picture

Title: Function split() is deprecated in htmltidy_run() (line 405 of htmltidy.module) » Function split() is deprecated in htmltidy_run() (line xxx of htmltidy.module)
Version: 7.x-1.0-beta1 » 7.x-1.0-beta2
Status: Active » Needs review
StatusFileSize
new932 bytes

Stumbled upon this in a simpletest environment with multilingual text. It gave me a very hard-to-track-down PDO error (inserting something into messages table failed).

Could be fixed with the attached patch (against beta2)

mgifford’s picture

This looks like a pretty straight forward patch.

colan’s picture

@mgifford: If you RTBC it, I'll commit it. ;)

mgifford’s picture

Issue summary: View changes
StatusFileSize
new912 bytes

That patch didn't apply neatly. This one should.

mgifford’s picture

I'm not sure where the problem for this is but in my local testing environment I got a WSOD & this Error message

Notice: Undefined index: htmltidy_filter_html in htmltidy_filter_htmltidy_process() (line 33 of /DRUPAL7/htmltidy/htmltidy.filter.inc).

on

  // Grab the filter settings so we can use them.
  $settings = $filter->settings['htmltidy_filter_' . $format->format];

But that might be a problem with the git repo or my local install.

dman’s picture

Testing (it's been a few years since I used this - and in D7 I usually have been trusting the htmlcorrector module and the wysiwygs)

* Downloaded current dev via git
* Enabled module on a brand new standard site
* Edited the text filter to enable it. admin/config/content/formats/full_html
* My binary was auto-detected OK
* (DISABLED htmlcorrector for testing) Enabled verbose debugging. Shifted htmltidy filter to the bottom.
* No WYSIWYG or anything is on.
* Added a page with crappy markup

<h2>Can I break</h3>
Using bad < markup and semi <tags> or
<script>alert('whoops')</script>
<p>nest<p>things<p>that shouldn't</body>
and stuff

... Um, nothing happened - I just got the bad text back out at me, filter didn't run.
Is the current code broken? drush+git gave me by default. 7.x-1.0-beta2

.. And on revisiting the page to edit it again I got

Fatal error: Call to undefined function drupal_set_html_head() in /private/var/www/drupal7/sites/all/modules/patched/htmltidy/htmltidy.module on line 195

I think I'll try the -dev and see what's up.
(forgive my noise, this may just be my confusion, but following the WSOD at #6 I thing we are on shaky ground with this old thing.

Suggestion - we can put a link to the repository INSTALL.txt in the project page, I had to go read it to remind myself what to do

dman’s picture

My error was unrelated and due to debugging option being on #1687846: drupal_set_html_head() should be drupal_add_html_head() for D7

BUT, I'm still not seeing the expected result - code is not being fixed by the filter, on preview, view or save.
Yet I do see the deprecated warning now so something is running.
Yes applying this patch makes the warning go away.
But is the module still working as an input filter?

dman’s picture

OK, looks like my sample bad HTML was too atrocious. Less-bad HTML does get cleaned up. HTML that is beyond help seems to fail silently though. :-(

It gives up when it sees

 <tags>

That is another issue.

This issue/patch however does indeed fix the split() warning :-)

Sorry for adding noise. It just looked like a quick test :-}

mgifford’s picture

It would be great if there was a sample page with bad html in it to try this against.

Good to know that the patch fixes the issue at hand. Bad to know that there are still a bunch of other issues with the module.

colan’s picture

Suggestion - we can put a link to the repository INSTALL.txt in the project page, I had to go read it to remind myself what to do

I added that as the Documentation link. It's not showing up, but that's probably because we have to wait for the cache to clear.