Jump to content

Bug fix and improvement suggestions


Recommended Posts

I have found a few bugs which I have fixed through hooks. It would be great if you fix them in the forum directly. Here's a list:

#1

// File: system/Theme/Advanced/Theme.php
// From:
...
	protected static function _writeThemePathDirectory( $app, $container, $path )
	{
...
			if ( ! @mkdir( $dirToWrite ) )
...
	}
...

// To:
...
	protected static function _writeThemePathDirectory( $app, $container, $path )
	{
...
			// This fixes recursive directory creation as some applications seem to need.
			if ( ! @mkdir( $dirToWrite, 0777, true ) )
...
	}
...

#2

// File: system/Image/Image.php

// From:
...
	public static function create( $contents )
	{
...
		$signatures = array(
			'gif'	=> array(
				'47' . '49' . '46' . '38' . '37' . '61',
				'47' . '49' . '46' . '38' . '39' . '61'
			),
			'jpeg'	=> array(
				'ff' . 'd8' . 'ff'
			),
			'png'	=> array(
				'89' . '50' . '4e' . '47' . '0d' . '0a' . '1a' . '0a'
			)
		);		
...
	}
...

// To:
...
	public static function create( $contents )
	{
...
        $signatures = array(
            'gif'	=> array(
                '47' . '49' . '46' . '38' . '37' . '61',
                '47' . '49' . '46' . '38' . '39' . '61'
            ),
            'jpeg'	=> array(
                'ff' . 'd8' . 'ff'
            ),
            'png'	=> array(
                '89' . '50' . '4e' . '47' . '0d' . '0a' . '1a' . '0a'
            ),
			// Some vBulletin images have this signature.
            'bmp'   => array(
                '42' . '4d' . '36' . '4f' . '00' . '00' . '00' . '00',
            )
        );
...
	}
...

 

Link to comment
Share on other sites

18 minutes ago, PurplePixel said:

if ( ! @mkdir( $dirToWrite, 0777, true ) )

Eeeeek. Change that 0777 to the constant IPS_FOLDER_PERMISSION.

Communicate this to IPS by opening a support request and provide a link here so it isn't missed.

Perhaps converting the bmp images using gd/imagemagick would be a better approach during the actual vBulletin converter run?

Link to comment
Share on other sites

15 hours ago, Paul E. said:

Eeeeek. Change that 0777 to the constant IPS_FOLDER_PERMISSION.

 

Will do. By default it's just mkdir() and that's what php.net says:

image.thumb.png.51088ca98a5c8da730632f233be9c575.png

So everywhere in the code it's actually 0777 set since the $mode parameter is not specified 😄

 

15 hours ago, Paul E. said:

Perhaps converting the bmp images using gd/imagemagick would be a better approach during the actual vBulletin converter run?

I will try and see if it worth the effort. I think during conversion some image manipulation is happening actually.

 

15 hours ago, Paul E. said:

Communicate this to IPS by opening a support request and provide a link here so it isn't missed.

Thanks, will do that.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...