Just want to request this change to nix the php notice I was getting

  if (((isset($_SERVER['HTTP_ACCEPT']) && strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml') > 0)) || ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE'])))) {

Comments

natuk’s picture

Version: 7.x-1.x-dev » 7.x-1.2

I am setting up a website which redirects to WorldPay for payments. If the user cancels the WorldPay transaction at WorldPay's website then a Drupal page with the notification of a cancelled transaction is returned through WorldPay's. My understanding is that the Drupal notification page is requested by WorldPay and returned through it. The message I get from mobile theme is:

Notice: Undefined index: HTTP_ACCEPT in mobile_theme_detect_php() (line 109 of /sites/all/modules/mobile_theme/mobile_theme.module).

and the page is not served with the mobile theme.

If line 109 is changed from this:

if ((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml') > 0) or ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE'])))) {

to this:

  if (isset($_SERVER['HTTP_ACCEPT']) and ((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml') > 0) or ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE']))))) {

Then obviously the problem goes away although the page is still served without a mobile theme, but I am not sure this can be avoided.

trante’s picture

I also get this error

Notice: Undefined index: HTTP_ACCEPT in mobile_theme_detect_php() (line 109 of /home/examplecom/public_html/sites/all/modules/mobile_theme/mobile_theme.module).

trante’s picture

Can anyone comment about this?

guenoz’s picture

I also have the error reported at #2

guenoz’s picture

StatusFileSize
new839 bytes
guenoz’s picture

Status: Active » Needs review
trante’s picture

Is it possible to add patch to dev version, by the developer?
Thank you

HorsePunchKid’s picture

StatusFileSize
new868 bytes

I had the same issue and arrived at the same solution, but here is a patch with fewer parentheses to keep track of and using the more ordinary boolean operators.

mrP’s picture

+1. The patch in #8 got rid of the error notices.

stewart.adam’s picture

Status: Needs review » Reviewed & tested by the community

#8 fixed it for me too, marking as RTBC.

robloach’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.