Jūs esateŽurnalai / Ernestas Kardzys's blog / Drupal. check_url() & MMS protocol

Drupal. check_url() & MMS protocol


ParašėErnestas Kardzys - 2010 Balandžio 24

I was coding a small dialog for my bachelor theses. There is a text box where you can enter an URL address. So, before submitting the form I validate that text box with check_url() function. The problem is, that my address starts with MMS. It's something like that: mms://www.server.lt/directory/file. So, after check_url() function the result is: //www.server.lt/directory/file. I was googling for the solution and I've finally found it. The problem is in file modules/filter/filter.module file, line 1182. "MMS" is not in the list of allowed protocols. So, there are two posable  solutions:
  1. Edit that line and add "mms". Well, this is not recommended, because by doing that you're hacking the Drupal core. So, forget this.
  2. The other solution is to download the module "Filter protocols" (http://drupal.org/project/filter_protocols) and add "mms" (or any other) protocol. This can be done by selecting Site configuration->By module->Input formats. The tab "Allowed protocols".
Good luck!

Skelbti naują komentarą

Šio laukelio turinys bus laikomas privatus ir nerodomas viešai.
  • Web puslapiu adresai ir el. pašto adresai automatiškai tampa nuorodomis.
  • Leidžiamos HTML žymės: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Linijos ir paragrafai atskiriami automatiškai
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].

Daugiau informacijos apie teksto formatavimą

CAPTCHA
Šis klausimas yra skirtas įsitikinti, jog jūs esate žmogus, ir sustabdyti automatinį šlamšto siuntimą.