I am having trouble ordering text format filters. If I put pathologic last, as recommended, then my email addresses are mangled messes of encoding and do not work (me@example.com becomes http://mysite.com/%26#109;ailto:me@example.com). If I put encode email addresses last, then some of my relative URLs are changed to the https protocol.

Link in source: /node/12345
Link in page: https://mysite.com/node/12345

Link in source: /sites/default/files/content/image1.jpg
Link in page: https://mysite.com/sites/default/files/content/image1.jpg

We do not use the https protocol at all on our site.

I have my processed URL formats set to full URL as follows:
http://prod.webhost.com
http://mysite.com
/

Should I set the filters to protocol relative URL?

If I remove the leading slash in front of node in my links it seems to work without adding the https. But I need the leading slash in front of file pointers to images and that path is also being changed to https.

Comments

Garrett Albright’s picture

With regards to the https:// thing, it's really bizarre that that would be happening in your site content if your site isn't accessible by https - are you sure it's not? - but yes, using the protocol-relative URL setting may help. Give it a try.

As for the mail address encoding thing, that definitely shouldn't be happening. Are you using the mailto: protocol in the link before the email address? Could you provide a before-and-after example of this happening?

Anonymous’s picture

I cannot reproduce the https thing right now, but here is a test page with the email thing: http://phsc.edu/node/59006 I will see if I can find an existing example of the https.

We have numerous subdomains using https and I thought something went awry there since this started happening about the time we were switching our domain from phcc to phsc, but our DNS guy said not. My web host pointed to the modules at the time.

Anonymous’s picture

Forgot to say we are just using an email address in the text. Emails have mailto: automagically added when flagged in the text formats filters, either HTML or JS wrapped. I just changed from JS wrapped to HTML to see if that was part of the problem.

Anonymous’s picture

The sample page is no longer displaying the encoded email, nor HTTPS. Looks like changing the filter order to Pathologic next to last and email with HTML to last worked, at least for now.

Thanks

botris’s picture

I have https problem on a site. Also numerous subdomains, only fix seems to be disabling the module.

Garrett Albright’s picture

Status: Active » Postponed (maintainer needs more info)

boris, can you give us more information? Is your site accessible via HTTPS at all? What's your input and output?

botris’s picture

Status: Postponed (maintainer needs more info) » Active

yes input could be:
- internet:node/109
- img src="/pathtoimage"
- Drupal menu links

Output seems to random switch between http and https.
There is no ssl certificate.
There are two url's accessing the site, a.com and a.nl through domain access.
Disabling the module worked.
Did not test if only changing the order of the module did the trick.
But I ended up writing a small helper module:

function MYMODULE_pathologic_alter(&$url_params, $parts, $settings) {
  $url_params['options']['https'] = FALSE;
}
Garrett Albright’s picture

How bizarre. I don't see why Pathologic should be doing this. Good thinking using hook_pathologic_alter() to work around it, though - these cases when Pathologic is just a little bit wrong is exactly why that hook is there.

Are you still using Pathologic 7.x-2.x? And do you have $base_url, $base_secure_url, or $base_insecure_url set anywhere in your settings.php file?

Perhaps Domain Access is also a clue…

botris’s picture

Hi Garrett, thanks for the followup.
Yes indeed it's still 7.x-2.x and no $base_url or a variant set.
The fact that it seems random makes it harder to debug.
Feel free to close it if you think it's a unique problem with some module combinations / domain access.

Garrett Albright’s picture

I'm going to leave it open because I'd like to see more info from others who might be using Domain and having problems. I hope you can give 7.x-3.x a try soon, though. :D

rickdonohoe’s picture

We use Pathologic 7.x-3.1, with a Drupal multi-site hosted on Acquia and this happens to us randomly.

We don't use the Domain module, and we don't have SSL, so every so often we get a load of broken links. Saving the offending page seems to do the job, though for footer elements I also found flushing the cache did the job.

Using CKEditor 7.x-1.16 too if that is of any help?

rickdonohoe’s picture

FYI: In Pathologic global settings I use the site live URL as follows:
http://www.romanbaths.co.uk
...and have Full URL option selected.

Should that not mean it keeps http;// ??

vinmassaro’s picture

We are also seeing the same issue on sites with 7.x-2.12 where the module is enabled but never configured. It is randomly changing URLs to HTTPS. Disabling the input filter fixes the issue.

ccarnnia’s picture

Hi All,
I off load https at the loadballancer and apche vhost is configured for port:80 only.
By default I set /admin/config/content/pathologic to `protocol relative`.
If I mistakenly choose the first option `FULL: URL` then the pages with embeded video or iframes with reative path get mixed mode error.
Should `http` even be an option any more?

mark_fullmer’s picture

Should `http` even be an option any more?

While, as a web developer, I can't think of a reason in the real world why HTTP would be justified (non-real-world testing, where an SSL certificate is difficult, is an exception), I believe there's an important distinction here: http is not an option in Pathologic. The Full URL option renders URLs that match the base paths using whatever the site response base URL is. If the response is over http, the links will be rendered with http. If the response is https, all links will be rendered with https.

So, while there may be no realistic scenario for http, I'm not sure that Pathologic should automatically convert the http protocol to https, regardless of what the site is using.

As suggested in comments #7 & #8, an individual site could hook into Pathologic's filter and rewrite the protocol, if desired, using hook_pathologic_alter().

If this were to be done in the module itself, maybe it should take the form of a new configuration option to "Convert HTTP to HTTPS"?