Welcome to Geeklog Thursday, November 23 2017 @ 11:02 pm EST

Fix for broken polls on Mac OS X 10.2

  • Contributed by:
  • Views: 4,325
Geeklog.net Polls do not work correctly for virtual sites on Mac OS X 10.2 from a regular install of GeekLog, the only flaw I have yet detected.

Mac OS X sets the environment variable REMOTE_ADDR to the IP of the server, not the remote user! Thus all votes appear to come from the same IP number.

As polls are restricted to one vote per IP number, only one vote can be cast for the entire site.

A quick fix is to put the following line at the beginning
of lib-common.php
$REMOTE_ADDR=$HTTP_PC_REMOTE_ADDR;

which will set REMOTE_ADDR to the correct remote address.