Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weird problems with GS3.2.0 and News Manager plugin
#14
@shawn_a

I don't understand is why D.O. didn't have this error in GS 3.1.2 but does in 3.2.0 with GSSUPPRESSERRORS enabled (wasn't this setting supposed to make it work like pre-3.2?)

This is the function where the error happens:
Code:
function nm_rename_file($oldfile,$newfile) {
  if (!rename($oldfile,$newfile)) {
   if (copy ($oldfile,$newfile)) {
       unlink($oldfile);
       return TRUE;
    }
    return FALSE;
  }
  return TRUE;
}

It's in the first if. I added that function precissely because some Windows systems couldn't move the file using rename if the destination existed.

I can think of two ways to fix D.O.'s problem,

replacing the if line by:
Code:
if (!@rename($oldfile,$newfile)) {

or by:
Code:
if ((strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') or !rename($oldfile,$newfile)) {

What do you suggest?
I prefer not to use the @ operator (in fact, I'd like to remove many of those that are in the plugin), but the second one looks a bit ugly to me. :-)

Or do you think I should leave it like it is, and it's D.O. (or any other Windows user having this issue) who should fix the server configuration?
Reply


Messages In This Thread
RE: Weird problems with GS3.2.0 and News Manager plugin - by Carlos - 2013-03-09, 07:46:40



Users browsing this thread: 5 Guest(s)