THIS SOFTWARE MODIFICATION IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
***USE AT YOUR OWN RISK***
***PLEASE TEST OUT THE MODIFICATIONS FIRST TO MAKE SURE IT WORKS ON THE SERVER YOU ARE INSTALLING IT ON.***
***MAKE BACKUPS OF YOUR EXISTING FILES AND DATABASE SO YOU CAN REVERT BACK TO THE PRE MODIFIED VERSION OF YOUR XMB INSTALLATION***
--------------------------------------------------
Tested on a Windows Dev Server running:
Apache: 2.4.27
MariaDB: 10.1.26
PHP: 7.1.8
--------------------------------------------------
Tested on a Linux Production Server running:
Yeah, it's also present 1.9.11. Either way, since it's a notice, you could probably get rid of displaying the error via ini_settings, but that doesn't
really solve the problem. I'd like to have all warnings on.Scarlet - 9-16-2017 at 12:44 PM
Nice thing linking to my thread I made earlier Xian - 9-16-2017 at 03:08 PM
function phpShorthandValue($ininame) {
$rawstring = trim(ini_get($ininame));
if (is_string($rawstring)) {
switch (substr($rawstring, -1)) {
case 'M': case 'm': return (int) $rawstring * 1048576;
case 'K': case 'k': return (int) $rawstring * 1024;
case 'G': case 'g': return (int) $rawstring * 1073741824;
}
}
return (int) $rawstring;
}
5. Save file.
6. Test
Please let me know how it goes.Jenny Lee - 9-16-2017 at 05:02 PM
That's how I fixed it for myself, yet I'm not sure what this function is used for in order to properly test it, but value is being returned the same
as in non edited version of PHP 5.
Either way, thanks for your code too. I might double check the output of
both fixes, but if responses are identical I think my way is a bit less messy as far as code goes.Xian - 9-16-2017 at 05:09 PM
As post attachment validations.Jenny Lee - 9-16-2017 at 05:20 PM
Nice, now I can actually test it out. Thanks for the pointers.Xian - 9-16-2017 at 05:29 PM
No problem!
Jenny Lee - 9-16-2017 at 06:50 PM
Alright, I wrote a little script to test that mess. As suspected, original throws an error while other two works just fine. I have attached the
script, so you could test it for yourself.
Use $_GET['size'] for testing custom values, but this is optional.
Attachment: test.php (2kB) This file has been downloaded 629 timesScarlet - 9-16-2017 at 08:27 PM
Since Jenny says her way is a cleaner piece of code I'll probably fix that with my own board before I finally upgrade the server to PHP 7. Just a
quick question, how do I upgrade from 5.6 to 7.0 on Debian 8 Jessie? I don't want to break anything if I try reading tutorials and such and I know I
can trust the XMB Community. lottos - 9-16-2017 at 10:04 PM
Xian, do you think we should have a number system for the beta? Just in case people who aren't following this topic download from sourceforge may
think the beta is the same, whereas it's already changed I think 3 times?
Since Jenny says her way is a cleaner piece of code I'll probably fix that with my own board before I finally upgrade the server to PHP 7.
I don't recommend using those fixes, because none of those those 3 functions(including original) were convenient enough. If user uses two letter
format (MB, KB, GB) instead of one( M,K,G) current functions just bails out or shows complete gibberish.
Use the one from fix.php attached to this post
Attachment: fix.php (662B) This file has been downloaded 579 times
In regards of php upgrading, you most likely need to use a package manager.
Something like apt-get install php7.1 should do.
P.S. If it does nothing you need to add repositories manually, I think.Xian - 9-16-2017 at 10:45 PM
Xian, do you think we should have a number system for the beta? Just in case people who aren't following this topic download from sourceforge may
think the beta is the same, whereas it's already changed I think 3 times?
eg: 1.9.12.2
LOL! You're right. Let's number them like that. I will update them when I get home.lottos - 9-17-2017 at 03:08 AM