[Discuss] Support Toolkit 1.0.1 released

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Scam Warning
User avatar
jmaraujo
Registered User
Posts: 240
Joined: Fri Jun 01, 2007 9:48 pm
Location: Rivera - Uruguay
Name: Juan

Re: [Discuss] Support Toolkit 1.0.1 released

Post by jmaraujo »

Phil wrote:I don't think you fully understand the way the STK works. The tool runs automatically. It does not change anything without the user's intervention; it simply alerts you to the fact that changes are necessary.
I have a "white page" (ucp.php?i=pm&folder=inbox) now too, after updating STK to the 1.0.1pl1 version. I haven't changed or edited anything; just visited the STK admin index page. :( :x

EDIT: Pointing my browser to ucp.php everything is fine (no "white page").

User avatar
Phil
Former Team Member
Posts: 10403
Joined: Sat Nov 25, 2006 4:11 am
Name: Phil Crumm
Contact:

Re: [Discuss] Support Toolkit 1.0.1 released

Post by Phil »

That shouldn't be possible. Please open a topic in the support forum.
Moving on, with the wind. | My Corner of the Web

Peter77sx
Registered User
Posts: 3258
Joined: Wed Nov 09, 2005 2:51 pm

Re: [Discuss] Support Toolkit 1.0.1 released

Post by Peter77sx »

jmaraujo wrote:
Phil wrote:I don't think you fully understand the way the STK works. The tool runs automatically. It does not change anything without the user's intervention; it simply alerts you to the fact that changes are necessary.
It actally does change phpbb files automaticly... in some cases cut the content in half... so some will get white blank page errors.
The whole BOM sniff idea should be optional, imo.

User avatar
Marshalrusty
Project Manager
Project Manager
Posts: 29253
Joined: Mon Nov 22, 2004 10:45 pm
Location: New York City
Name: Yuriy Rusko
Contact:

Re: [Discuss] Support Toolkit 1.0.1 released

Post by Marshalrusty »

Peter77sx wrote:It actally does change phpbb files automaticly... in some cases cut the content in half... so some will get white blank page errors.
While I'm open to possibility that there is a bug here, simply repeating this does not make it more plausible. From what I see (and I didn't write this), the file is opened in read only mode to check for the BOM. So what you're saying should be impossible.
Peter77sx wrote:The whole BOM sniff idea should be optional, imo.
Again, editing files is always optional, but I see no problem in checking automatically. phpBB itself does many things in the background without explicitly asking for your approval.

You are currently expressing disagreement with something that is not actually there to begin with. If I am mistaken, please point out where the code could be slicing a file in half.
Have comments/praise/complaints/suggestions? Please feel free to PM me.

Need private help? Hire me for all your phpBB and web development needs

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: [Discuss] Support Toolkit 1.0.1 released

Post by RMcGirr83 »

The files are read, altered and then stored in the store directory with a message given to the end user. From includes/critical_repair.bom_sniffer.php

Code: Select all

		// Once finished always write the new data back to the cache file
		$this->cache->storedata();

		// Inform the user what to do if we've created files
		if (is_dir(PHPBB_ROOT_PATH . 'store/bom_sniffer'))
		{
			$this->trigger_message($this->messages['issue_found']);
		}
and where in that file the code has a bug starts with line 193 (using quote for coloring purposes)
// Between open and closing tag
if (!$php_close)
{
// Everything between the tags is added without further checking
if (($pos = strpos($buffer, $this->php_close)) === false)
{
$this->add_to_write_buffer($buffer);
continue;
}

// Some files contain a closing tag while it isn't an actual tag.
// Work around those nasty ones
if ($this->ifItLooksLikeADuckWalksLikeADuckAndSoundsLikeADuckItIsntADuck($buffer, $directory, $file))
{
$this->add_to_write_buffer($buffer);
continue;
}

// If the line is longer than the closing tag its been changed
if (strlen($buffer) > strlen($this->php_close))
{
$this->file_changed = "Closing tag same line";
}

// Trash everything after the closing tag
$buffer = substr($buffer, 0, ($pos + strlen($this->php_close)));
$this->add_to_write_buffer($buffer);
$php_close = true;
continue;
}

// Everything after the closing tag is junk
if ($php_close)
{
// Ignore
$this->file_changed = true;
continue;
}
}
this function ifItLooksLikeADuckWalksLikeADuckAndSoundsLikeADuckItIsntADuck will work around known phpBB files that have closing tags within the code. Nice function name btw. :)

So if a user is given that message,
As part of the critical repair toolset of the Support Toolkit the STK has checked your phpBB files and determined that some of the files contain invalid content that potentially could stop the board from operating. The support Toolkit has tried to fix those issues and created a package with the updated files in the "store" directory of your board.<br /> Please <strong>move</strong> the files from the “store” directory to their correct location and load the Support Toolkit again. The toolkit will check these files again and will redirect you to the STK if no flaws are found.


they will then assume they have to download these changed files and upload them into the proper places overwriting what could possibly be perfectly valid files to begin with.
phpBB itself does many things in the background without explicitly asking for your approval.
..and you are always told first to make a backup of your files if, for example, updating the board. Possibly, if it is the idea to continue to have the sniffer run automatically upon visiting the STK, the program should make backups of the files it is changing? Similar to what Automod does when it installs a mod (it creates a backup of the unedited files).

BTW, to disable the automatic-ness of the bom sniffer, just open the stk/index.php file, find this line

Code: Select all

$critical_repair->run_tool('bom_sniffer');
and replace it with this

Code: Select all

//$critical_repair->run_tool('bom_sniffer');
then it won't run and the tool kit will be able to be used without running the bom_sniffer at all.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: [Discuss] Support Toolkit 1.0.1 released

Post by RMcGirr83 »

FWIW, I just tried it on a forum that has zero problems and the bom sniffer returns this
36 Files, 14 Folders
one of the files having this as the only code in the file

Code: Select all

<?php
//
// Blank HTML Page
//
?>
<html>
<head>
<title>You Can't Browse</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="refresh" content="5; url=http://betraythis.com">
</head>

<body bgcolor="#FFFFFF" text="#000000">
You are not allowed to view this directory
</body>
</html>
and it made it into this

Code: Select all

<?php
//
// Blank HTML Page
//
?>
This file is nothing more than a "no viewing this directory page". Also, it took every single one of the coppermine gallery files and over wrote them as well (which I have integrated with phpBB) returning some php files with absolutely nothing in them after the re-write (because there is only HTML within a php file).

I'll say it again, not a good idea to have this bom sniffer run automatically.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
Phil
Former Team Member
Posts: 10403
Joined: Sat Nov 25, 2006 4:11 am
Name: Phil Crumm
Contact:

Re: [Discuss] Support Toolkit 1.0.1 released

Post by Phil »

Erik has reworked the tool to scan only vanilla phpBB files. It is our intention to leave this tool in place (yet add the possibility to ignore its results) and introduce another optional tool that will scan all files.
Moving on, with the wind. | My Corner of the Web

User avatar
jmaraujo
Registered User
Posts: 240
Joined: Fri Jun 01, 2007 9:48 pm
Location: Rivera - Uruguay
Name: Juan

Re: [Discuss] Support Toolkit 1.0.1 released

Post by jmaraujo »

jmaraujo wrote:I have a "white page" (ucp.php?i=pm&folder=inbox) now too, after updating STK to the 1.0.1pl1 version. I haven't changed or edited anything; just visited the STK admin index page. :( :x

EDIT: Pointing my browser to ucp.php everything is fine (no "white page").
I just checked my files, and the modified file that I had to move from the /store folder was cut in half. That's why I was getting a white page.

After reuploading the original file the "white page" error is gone.

User avatar
Phil
Former Team Member
Posts: 10403
Joined: Sat Nov 25, 2006 4:11 am
Name: Phil Crumm
Contact:

Re: [Discuss] Support Toolkit 1.0.1 released

Post by Phil »

Can you PM me the original file (the one that was cut in half)?
Moving on, with the wind. | My Corner of the Web

User avatar
jmaraujo
Registered User
Posts: 240
Joined: Fri Jun 01, 2007 9:48 pm
Location: Rivera - Uruguay
Name: Juan

Re: [Discuss] Support Toolkit 1.0.1 released

Post by jmaraujo »

Phil wrote:Can you PM me the original file (the one that was cut in half)?
Yes, I'll send you the files. The file gets cut right before the first "?>"

Part of the original file:

Code: Select all

    if($highlight_match)
    {
        if($match == PM_SEARCH_MATCH_WORD)
        {
            $message = preg_replace('#(?!<.*)(?<!\w)(' . $highlight_match . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">\1</span>', $message);
        }
        else
        {
            $message = preg_replace('#(?!<.*)(?<!\.)(' . $highlight_match . ')(?!\.|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">\1</span>', $message);
        }
    } 
Part of the of the modified cutted file:

Code: Select all

    if($highlight_match)
    {
        if($match == PM_SEARCH_MATCH_WORD)
        {
            $message = preg_replace('#(?!<.*)(?<!\w)(' . $highlight_match . )(?!w|[^<>]*(?:</s(?:cript|tyle)) 
And then the file abruptly ends right before the "?>"...

User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 5036
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: [Discuss] Support Toolkit 1.0.1 released

Post by VSE »

Well, I don't get it... The database cleaner is giving me so much troubles! :x

I installed STK 1.0.1-PL1 on an almost vanilla board on a different server to see if it would run without problems as I'm being told it does...

Well, the Database Tables phase of the cleaner told me ALL my default phpbb_ tables were extras, and wanted to remove them... I unmarked all of them so as not to remove them, hit submit, and:
[phpBB Debug] PHP Notice: in file /stk/includes/database_cleaner/database_cleaner_views.php on line 182: Undefined index: COLUMNS
[phpBB Debug] PHP Notice: in file /stk/includes/database_cleaner/database_cleaner_views.php on line 182: array_keys() expects parameter 1 to be array, null given
[phpBB Debug] PHP Notice: in file /stk/includes/database_cleaner/database_cleaner_views.php on line 182: array_merge() [function.array-merge]: Argument #1 is not an array
[phpBB Debug] PHP Notice: in file /stk/includes/database_cleaner/database_cleaner_views.php on line 182: array_unique() expects parameter 1 to be array, null given
[phpBB Debug] PHP Notice: in file /stk/includes/database_cleaner/database_cleaner_views.php on line 183: sort() expects parameter 1 to be array, null given
[phpBB Debug] PHP Notice: in file /stk/includes/database_cleaner/database_cleaner_views.php on line 185: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /stk/includes/database_cleaner/database_cleaner_views.php on line 182: Undefined index: COLUMNS
[phpBB Debug] PHP Notice: in file /stk/includes/database_cleaner/database_cleaner_views.php on line 182: array_keys() expects parameter 1 to be array, null given
[phpBB Debug] PHP Notice: in file /stk/includes/database_cleaner/database_cleaner_views.php on line 182: array_merge() [function.array-merge]: Argument #1 is not an array
[phpBB Debug] PHP Notice: in file /stk/includes/database_cleaner/database_cleaner_views.php on line 182: array_unique() expects parameter 1 to be array, null given
[phpBB Debug] PHP Notice: in file /stk/includes/database_cleaner/database_cleaner_views.php on line 183: sort() expects parameter 1 to be array, null given
[phpBB Debug] PHP Notice: in file /stk/includes/database_cleaner/database_cleaner_views.php on line 185: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4289: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4291: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4292: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4293: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)
I posted this in the bug tracker in the Database Cleaner thread... It has now failed me on two different servers, and failed within php 5.2.11 and 5.3.2 :cry:
Official phpBB Extensions ⭐️ My Extensions & MODs 🔔 YES!!! They ALL work with phpBB 3.3.x 🔔
Please do not PM me for support.

User avatar
Marshalrusty
Project Manager
Project Manager
Posts: 29253
Joined: Mon Nov 22, 2004 10:45 pm
Location: New York City
Name: Yuriy Rusko
Contact:

Re: [Discuss] Support Toolkit 1.0.1 released

Post by Marshalrusty »

VSE, would you mind sending me a copy of your files (just an archive of the entire phpBB folder)?

EDIT: Scratch that, we've been able to reproduce it under a specific set of conditions.
Have comments/praise/complaints/suggestions? Please feel free to PM me.

Need private help? Hire me for all your phpBB and web development needs

AgeOfStrife
Registered User
Posts: 15
Joined: Wed Apr 01, 2009 9:28 am
Contact:

Re: [Discuss] Support Toolkit 1.0.1 released

Post by AgeOfStrife »

Phil wrote:Erik has reworked the tool to scan only vanilla phpBB files. It is our intention to leave this tool in place (yet add the possibility to ignore its results) and introduce another optional tool that will scan all files.
Sounds like a good idea - this tripped me up too this evening, but I realised I could just comment out the check and carry on. I have phpBB installed in my site root folder and there are plenty of other folders and files on the site that are totally unrelated to phpBB, and it refused to let me continue because of some of these - for example, a folder that contains the output of a command line tool that dumps charts of system resource usage, as well as cache files from a Menalto Gallery 2 installation. While the tool would generally be fine if run where the parent folder contains only phpBB, blindly checking all php files in a "root" install can cause problems.

It did however work great on another site I run that has recently had a clean install of phpBB, plus a few mods such as phpBB Tracker, Filebase, Board3 Portal, and plenty of hacks by myself; that was the first site I ran it on as I needed to fix a problem with the ACP module tree getting messed up (I moved a module using the ACP and suddenly a module became the parent of a number of categories ...)

On the whole the tools are great, but I'm going to have to remove access to the option to remove all non-standard columns from tables :P
Dan
Age of Strife owner

User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 5036
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: [Discuss] Support Toolkit 1.0.1 released

Post by VSE »

Marshalrusty wrote:EDIT: Scratch that, we've been able to reproduce it under a specific set of conditions.
Well at least now I know I'm not crazy :lol:

Does it have anything to do with this deprecated php.ini thing:
; Whether to enable the ability to force arguments to be passed by reference
; at function call time. This method is deprecated and is likely to be
; unsupported in future versions of PHP/Zend. The encouraged method of
; specifying which arguments should be passed by reference is in the function
; declaration. You're encouraged to try and turn this option Off and make
; sure your scripts work properly with it in order to ensure they will work
; with future versions of the language (you will receive a warning each time
; you use this feature, and the argument will be passed by value instead of by
; reference).
allow_call_time_pass_reference = Off
Official phpBB Extensions ⭐️ My Extensions & MODs 🔔 YES!!! They ALL work with phpBB 3.3.x 🔔
Please do not PM me for support.

User avatar
Marshalrusty
Project Manager
Project Manager
Posts: 29253
Joined: Mon Nov 22, 2004 10:45 pm
Location: New York City
Name: Yuriy Rusko
Contact:

Re: [Discuss] Support Toolkit 1.0.1 released

Post by Marshalrusty »

No, it has to do with the order of items in a dynamically generated array which seems to depend on factors like PHP version and operating system. It was assumed that the items are ordered, but this is not always the case, and that caused some overwriting. It's a one line change and we are still working out what we want to do about these few bugs that were mixed.

Again, I apologize for the inconvenience this has caused you folks.
Have comments/praise/complaints/suggestions? Please feel free to PM me.

Need private help? Hire me for all your phpBB and web development needs

Locked

Return to “phpBB Discussion”