MitsubaBBS / Mitsuba

Project Mitsuba - an opensource imageboard software written in PHP
http://mitsuba.cf/
Other
42 stars 20 forks source link

Unexpected '[' on line 166 of butter.php & Board Links #71

Open WASasquatch opened 10 years ago

WASasquatch commented 10 years ago

I believe it's because there are no posts that it is trying to fetch from, is there a simple work around for this? Line of code in question is the fetch_array

$result = $this->conn->query("SELECT sum(orig_filesize) FROM posts"); $num_bytes = $result->fetch_array()[0];

WASasquatch commented 10 years ago

Here is my fix, works well enough

$result = $result->fetch_array(); if (!isset($result) && !is_array($result)) { $num_bytes = 0; } else { $num_bytes = $result[0]; }

And allows me to continue forward with rebuilding cache. However... no I am stuck.

When I make board links, no matter what, they aren't links. Just plain text.

pavulon commented 10 years ago

This error is present only in PHP versions lower than 5.4, where you can't do the function array dereferencing.

WASasquatch commented 10 years ago

Yeah I found that out. What about board links? They don't ever seem to generate links at all, even with a URL, base root to board, or w/e. Just can't seem to get it to produce a link, it just becomes text. Is this another PHP 5.3 issue as compared to 5.4?

pavulon commented 10 years ago

Probably. I can't reproduce the bug on 5.5.

WASasquatch commented 10 years ago

Ehh, WAMP needs to upgrade. Looks like I need to manually install pho and apache. On Feb 5, 2014 4:57 AM, "JanPavulon" notifications@github.com wrote:

Probably. I can't reproduce the bug on 5.5.

Reply to this email directly or view it on GitHubhttps://github.com/MitsubaBBS/Mitsuba/issues/71#issuecomment-34163196 .

pavulon commented 10 years ago

You can try out XAMPP, it's pretty similar.

WASasquatch commented 10 years ago

I think ill just hold off until the dedi is up and I can vm a debian distro to spare this trouble. Windows is evil On Feb 5, 2014 11:59 AM, "JanPavulon" notifications@github.com wrote:

You can try out XAMPP, it's pretty similar.

Reply to this email directly or view it on GitHubhttps://github.com/MitsubaBBS/Mitsuba/issues/71#issuecomment-34231069 .