I got this warning Warning: strpos() expects parameter 1 to be string, array given in blueprint_preprocess_page() (line 53 of /var/www/mysite/sites/all/themes/blueprint/blueprint/template.php).
this is the code in template.php:

 if (!module_exists('page_title')) {
    // Fixup the $head_title and $title vars to display better.
    $title = drupal_get_title();
    $headers = drupal_set_header();

    // if this is a 403 and they aren't logged in, tell them they need to log in
    if (strpos($headers, 'HTTP/1.1 403 Forbidden') && !$user->uid) {
      $title = t('Please login to continue');
    }
    $vars['title'] = $title;

    if (!drupal_is_front_page()) {
      $vars['head_title'] = $title .' | '. $vars['site_name'];
      if ($vars['site_slogan'] != '') {
        $vars['head_title'] .= ' – '. $vars['site_slogan'];
      }
    }
    $vars['head_title'] = strip_tags($vars['head_title']);
  }
 

i am using following config for my site.
Pressflow - 6.20
PHP - 5.3.2-1ubuntu4.9
Blueprint - 6.x-2.0

i got this warning after upgrade php version 5.2.x to 5.3.2-1ubuntu4.9.

Comments

shrop’s picture

I am having the same issue on lines 33 and 42, but I am running version 6.x-1.7.

I am also running Pressflow (6.22) with PHP 5.3. I will take a close look and see if I can find a fix. I need to upgrade to 6.x-2.0 in the process anyway and I have interest in making sure I can use PHP 5.3.

shrop’s picture

So, it appears to be a warning in php 5.3. I can't tell that the there is really any issue because my $titles are being written correctly at page load. I just changed the error reporting to write to log and not screen at: admin/settings/error-reporting. That helps for now, but the warning is still being reported.

sarjeet.singh’s picture

this issue related with pressflow. drupal_set_header method return a array.
please try this code for pressflow. it will be work.

//Play nicely with the page_title module if it is there.
  if (!module_exists('page_title')) {
    // Fixup the $head_title and $title vars to display better.
    $title = drupal_get_title();
    $headers = drupal_set_header();

    // if this is a 403 and they aren't logged in, tell them they need to log in
    if (in_array('HTTP/1.1 403 Forbidden', (array)$headers) && !$user->uid) {
      $title = t('Please login to continue');
    }
    $vars['title'] = $title;

    if (!drupal_is_front_page()) {
      $vars['head_title'] = $title .' | '. $vars['site_name'];
      if ($vars['site_slogan'] != '') {
        $vars['head_title'] .= ' – '. $vars['site_slogan'];
      }
    }
    $vars['head_title'] = strip_tags($vars['head_title']);
  }