Coder Social home page Coder Social logo

Comments (35)

Polarbear541 avatar Polarbear541 commented on May 23, 2024

Obviously the dot issue will need to be fixed. And personally I don't think we should be as strict on validation, especially in terms of www. Many websites are subdomains and people don't really expect to have to put the www in :P

from mybb.

Polarbear541 avatar Polarbear541 commented on May 23, 2024

Note this occurs in the stable branch too.

from mybb.

euantorano avatar euantorano commented on May 23, 2024

Hm. The issue seems to be related to this block in inc/datahandlers/user.php:

    // Does the website start with http(s)://?
    if(!validate_website_format($website))
    {
        $this->set_error('invalid_website');
        return false;
    }

Thing is, the function "validate_website_format" is nowhere to be found in the user datahandler... Maybe I'm just being stupid?

from mybb.

euantorano avatar euantorano commented on May 23, 2024

Also just checked crossreference at mybboard.de. No listing of the above function either. Odd.

from mybb.

Stefan-MyBB avatar Stefan-MyBB commented on May 23, 2024

It's in inc/functions.php: https://github.com/mybb/mybb/blob/feature/inc/functions.php#L5320

from mybb.

euantorano avatar euantorano commented on May 23, 2024

Ah, thanks Stefan. No idea why it didn't show up in sublime function search.
On Jan 28, 2013 1:38 PM, "Stefan T." [email protected] wrote:

It's in inc/functions.php:
https://github.com/mybb/mybb/blob/feature/inc/functions.php#L5320


Reply to this email directly or view it on GitHubhttps://github.com//issues/16#issuecomment-12781874.

from mybb.

Stefan-MyBB avatar Stefan-MyBB commented on May 23, 2024

@Sama34 This happens when somebody changes code without creating a ticket for SQA: bae6745
Nobody knows about it and tests it...

from mybb.

euantorano avatar euantorano commented on May 23, 2024

@Sama34 Your regex in validate_website_format is incorrect. It forces www. and doesn't take into account subdomains or anything. This is a more complete one I think:

^(ht|f)tp(s)?:\/\/w{0,3}[a-zA-Z0-9_\-.:#/~}]+$

Tested it in regexr against URLs with subdomains, ftp://,ftps://,http://,https://

from mybb.

euantorano avatar euantorano commented on May 23, 2024

Alternatively, we could also use filter_var. It's PHP 5.2+ without the PECL extension though :( Wish we could bump the system requirements to PHP 5.2...

filter_var($website, FILTER_VALIDATE_URL);

from mybb.

tommm avatar tommm commented on May 23, 2024

We can bump it. I would suggest, at a minimum, 5.3.

Sent from my iPad

On 28 Jan 2013, at 14:11, "Euan T." [email protected] wrote:

Alternatively, we could also use filter_var. It's PHP 5.2+ without the PECL extension though :( Wish we could bump the system requirements to PHP 5.2...

filter_var($website, FILTER_VALIDATE_URL);

Reply to this email directly or view it on GitHub.

from mybb.

nmalcolm avatar nmalcolm commented on May 23, 2024

We should probably review the installation statistics to check if that's wise. I asked Tim for them a while ago but I assume he forgot.

from mybb.

euantorano avatar euantorano commented on May 23, 2024

@tommm I would LOVE if we could bump to 5.3, though I seem to remember seeing install statistics fairly recently(?) that said quite a few people are still restricted to 5.2 :( Could be wrong. Hopefully Tim can shed some insight as @nmalcolm said.

from mybb.

PenguinPaul avatar PenguinPaul commented on May 23, 2024

I think a majority of people are still on 5.2.17, it seems to be the most common... my shared host has it. I'll poke them about upgrading though :P

from mybb.

euantorano avatar euantorano commented on May 23, 2024

That's the unfortunate position I think many people are still in sadly. Some hosts suck at keeping up to date. 5.3 has been out for ages now and there's no excuse for not upgrading.

from mybb.

Stefan-MyBB avatar Stefan-MyBB commented on May 23, 2024

@tommm This code is also in 1.6, no chance to change the requirements. ;)

from mybb.

PenguinPaul avatar PenguinPaul commented on May 23, 2024

I think we could bump 1.8 to 5.2.

from mybb.

PenguinPaul avatar PenguinPaul commented on May 23, 2024

My host just informed me they're upgrading to PHP 5.4 in a few weeks. Let's hurry up and make MyBB 5.4 compatible :P

from mybb.

euantorano avatar euantorano commented on May 23, 2024

I still think that we'll probably have to set the minimum version to 5.2 unfortunately. Hopefully Tim can get us some install stats though so we can be 100% sure.

from mybb.

tommm avatar tommm commented on May 23, 2024

Most reputable hosts are capable of 'turning on' PHP 5.3.

from mybb.

euantorano avatar euantorano commented on May 23, 2024

Yes, but we get many users using less reputable hosts and even free hosts. We can't just bump system requirements without properly breaking down the number of installs on our target environments.

from mybb.

Polarbear541 avatar Polarbear541 commented on May 23, 2024

http://community.mybb.com/attachment.php?aid=20308
And these were from two years ago :p
Gives a clear idea that PHP 5.2 isn't an issue here ^_^.

In terms of 5.3, well that remains to be seen.

from mybb.

euantorano avatar euantorano commented on May 23, 2024

We should be fairly okay with 5.2 then. Question is, has 5.3 support stepped up?

from mybb.

Stefan-MyBB avatar Stefan-MyBB commented on May 23, 2024

You want to change the requirements because of this?
And we still need a solution for 1.6.

from mybb.

Polarbear541 avatar Polarbear541 commented on May 23, 2024

What exactly was the issue with the code in the first place?
If it seemed to work then why did we change it? :P

from mybb.

tommm avatar tommm commented on May 23, 2024

What's the original problem? What was this supposed to fix?

Sent from my iPad

from mybb.

euantorano avatar euantorano commented on May 23, 2024

Not entirely sure. Omar pushed to fix a bug not on the tracker.

from mybb.

JN-Jones avatar JN-Jones commented on May 23, 2024

http://community.mybb.com/thread-131562.html I think this is the (internal) Thread we discussed this.

from mybb.

Stefan-MyBB avatar Stefan-MyBB commented on May 23, 2024

I'm going to revert this in 1.6 if nobody commits a working solution.

from mybb.

euantorano avatar euantorano commented on May 23, 2024

Probably the best course of action. It works as is so why change it?

from mybb.

xaoseric avatar xaoseric commented on May 23, 2024

I could be wrong, but I asked cpanel, their upgrader, and installer installs 5.3 automatically, so unless hosts rebuild and choose 5.2.17, they are using 5.3. @PenguinPaul php 5.4 hasnt been shiped yes, although it should ship before june in time for a cpanel update

from mybb.

Stefan-MyBB avatar Stefan-MyBB commented on May 23, 2024

@trainhappy Not everybody uses cpanel...

from mybb.

Stefan-MyBB avatar Stefan-MyBB commented on May 23, 2024

Reverted in 1.6: 2b05b92

from mybb.

Sama34 avatar Sama34 commented on May 23, 2024

This was totally my mistake and I fell really sorry about it. I shouldn't have apply this featured this way or probably at all. No hard feeling, but the mistake is quite obvious.

Any other revert required just mention it so none wastes their time with this.

from mybb.

nmalcolm avatar nmalcolm commented on May 23, 2024

We'll be bumping up the minimum PHP version to 5.2 so we can use filter_var().

from mybb.

nmalcolm avatar nmalcolm commented on May 23, 2024

This is no longer an issue as the commit was reverted.

from mybb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.