WordPress.org

Ready to get started?Download WordPress

Forums

WP phpBB Bridge
Errors Generated when Bridge Activated (7 posts)

  1. macmiller
    Member
    Posted 2 years ago #

    I have been testing the bridge in a test environment. I have the environment set up to show non fatal errors. The following errors get triggered once the 'Activate Bridge' switch is set to Yes. The bridge does seem to be working, just wondering if all of these errors should be generated and if they might indicate a problem and if they are something unique to my environment.

    Notice: Use of undefined constant STRIP - assumed 'STRIP' in /srv/www/virtual/sample.com/htdocs/forum/includes/functions.php on line 54 Notice: Use of undefined constant STRIP - assumed 'STRIP' in /srv/www/virtual/sample.com/htdocs/forum/includes/functions.php on line 54 Notice: registration.php is deprecated since version 3.1 with no alternative available. This file no longer needs to be included. in /srv/www/virtual/forum.com/htdocs/blog/wp-includes/functions.php on line 3424 Notice: Undefined property: user::$ID in /srv/www/virtual/sample.com/htdocs/blog/wp-content/plugins/wp-phpbb-bridge/plugin.php on line 73 Notice: Undefined variable: redirect_to in /srv/www/virtual/sample.com/htdocs/blog/wp-content/plugins/wp-phpbb-bridge/plugin.php on line 87

  2. macmiller
    Member
    Posted 2 years ago #

    I may or may not be fixing these in the best manor possible. For the STRIP error I added this code to plugin.php:

    if (version_compare(PHP_VERSION, '6.0.0-dev', '>='))
    {
    	/**
    	* @ignore
    	*/
    	define('STRIP', false);
    }
    else
    {
    	@set_magic_quotes_runtime(0);
    
    	// Be paranoid with passed vars
    	if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on' || !function_exists('ini_get'))
    	{
    		deregister_globals();
    	}
    
    	define('STRIP', (get_magic_quotes_gpc()) ? true : false);
    }

    after

    require($phpbb_config);

    For the registration.php is depreciated I commented out this line (out of plugin.php)

    //	require_once(ABSPATH . WPINC . '/registration.php');

    (there is nothing in the file it is only a stub returning the error)

    For the Undefined property: user::$ID it comes from this code in plugin.php:

    else if($userid > 0 && $userid != $user->ID)

    Any idea what this should be??

    For the final redirect_to error, it comes from this code in plugin.php:
    $redirect = trim($redirect_to);
    There is no indication or previous setting of this variable, $redirect_to, that I can fine. Not sure what it is supposed to be.

    Appreciate any help in resolving these last couple of error messages.

  3. macmiller
    Member
    Posted 2 years ago #

    After looking at the session.php file within phpBB (version 3.0.8) I decided to change the line producing the error in plugin.php as follows

    code before:
    else if($userid > 0 && $userid != $user->ID)
    changed to:

    else if($userid > 0 && $userid != $user->data['user_id'])

    this is just a guess as the next option was to just check property_exists to eliminate the error. I looked at previous versions of the phpBB session.php and the user class and did not see ID as a variable in any of them (so it seems like the error has been around for a while).

  4. macmiller
    Member
    Posted 2 years ago #

    just added a check to see if $redirect_to is set as I couldn't see where this might be set or what it might mean. This is in plugin.php
    $redirect = trim($redirect_to);
    changed to

    if (isset($redirect_to)) {
    		$redirect = trim($redirect_to);
    	}
  5. mbazdell
    Member
    Posted 2 years ago #

    hah. Awesome work dude. I was about to start digging into these. I'll give it a shot tomorrow and report back any issues.

  6. mbazdell
    Member
    Posted 2 years ago #

    Well so far so good. No more errors and it still seems to be working (other than an unrelated issue I'm having with it). Good job and thanks!

  7. macmiller
    Member
    Posted 2 years ago #

    There are two more undefined index errors generated when the form widget is first added. To have them not generate an error and default a value make the following two changes:

    change this
    <input id="<?php echo $this->get_field_id('login_title'); ?>" name="<?php echo $this->get_field_name('login_title'); ?>" type="text" value="<?php echo $instance['login_title']; ?>" />

    to this
    <input id="<?php echo $this->get_field_id('info_title'); ?>" name="<?php echo $this->get_field_name('info_title'); ?>" type="text" value="<?php echo isset($instance['info_title']) ? $instance['info_title'] : '{USERNAME}'; ?>" />

    and change this
    <input id="<?php echo $this->get_field_id('info_title'); ?>" name="<?php echo $this->get_field_name('info_title'); ?>" type="text" value="<?php echo $instance['info_title']; ?>" />

    to this
    <input id="<?php echo $this->get_field_id('info_title'); ?>" name="<?php echo $this->get_field_name('info_title'); ?>" type="text" value="<?php echo isset($instance['info_title']) ? $instance['info_title'] : '{USERNAME}'; ?>" />

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic