Problem:
When I activate "Site aliasing" from Hosting->Features and Aegir verifies itself it throws (in the Modalframe) the:
preg_match(): Unknown modifier '/' hosting_alias.module:493
The same is happening when I try from the modules menu and then try to create a site:
warning: preg_match(): Unknown modifier '/' in /var/aegir/hostmaster-6.x-2.0/profiles/hostmaster/modules/hosting/alias/hosting_alias.module on line 493.

I try to fix the regular expression but with no results.

Clean install of:
Aegir 6.x-2.0
PHP 5.3.3
Apache 2.2.15
OS Centos 6.4

Comments

ergonlogic’s picture

The preg_match() looks fine. Did you perhaps add a '/' in the 'Domain used for automatic subdomain hosting' field? Perhaps we need some validation there.

tvl’s picture

Thanks for the fast respond!
You are absolutely correct! I had add a '/' in Hosting->Site aliases->"Domain used for automatic subdomain hosting"
After the correction everything works smooth.

tvl’s picture

Status: Active » Closed (works as designed)
ergonlogic’s picture

Title: preg_match() wrong expression » Validate automatic domain field
Version: 6.x-2.0 » 7.x-3.x-dev
Status: Closed (works as designed) » Active
Issue tags: -regular expression +validation

We still need to validate this field, since it's throwing un-helpful PHP errors.

chertzog’s picture

Status: Active » Needs review

Here is a patch that validates the domain.

http://drupalcode.org/sandbox/chertzog/2088757.git/patch/c98ef8c

  • helmo committed 165d109 on 7.x-3.x authored by chertzog
    Issue #2183551 by tvl: Fixed Validate automatic domain field.
    

  • helmo committed eadfe88 on 7.x-3.x
    Issue #2183551 by helmo: Quote a var used in preg_match()
    
helmo’s picture

Status: Needs review » Fixed

I've committed the patch from #5. (new url http://cgit.drupalcode.org/sandbox-chertzog-2088757/commit/?id=c98ef8c)

I'm not sure the use of valid_url() is strict enough, but it's a good start.

The commit from #7 adds quoting to avoid "Unknown modifier '/'" erros being possible.

  • helmo committed 165d109 on dev-helmo-3.x authored by chertzog
    Issue #2183551 by tvl: Fixed Validate automatic domain field.
    
  • helmo committed eadfe88 on dev-helmo-3.x
    Issue #2183551 by helmo: Quote a var used in preg_match()
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.