GithubHelp home page GithubHelp logo

moodle-filter_multilangsecond's People

Contributors

michael-milette avatar vanyog avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

michael-milette

moodle-filter_multilangsecond's Issues

PREG_BACKTRACK_LIMIT_ERROR $search0 optimize

I had a heavily nested html enclosed by

tags and the regex callback for $search0 returned null because of PREG_BACKTRACK_LIMIT_ERROR. You may use my fix
$search0 = '/(?:<([a-z]+)[^>]*?lang=".*?".*?>.*?<\/\1>).*<\1[^>]*?lang=".*?".*?>.*?<\/\1>/is';
Edit: THIS IS NOT CORRECT!

Disappearing space

Hi,

I have enabled your multilang filter for content and headings and am processing both the Moodle core multilang syntax as well as your new simplified syntax.

In one of our custom plugins, we are sending strings like
SommersemesterSummer term 2013
through format_string().

As a result, we see that the space between the closing span and "2013" is missing!

If I do the same with the Moodle core multilang filter, the space is still there as it should be.

For your information:
If I send
2013 SommersemesterSummer term
through format_string() with your filter, the space is there in the resulting string as it should be.

Could you please have a look at this?

Thanks,
Alex

Notice: Undefined index: en in filter.php on line 106

Hi Vanyo,

There seems to be a bug in your recently released 2014032300 version of the multilangsecond code. The bug only becomes obvious in Moodle when you have debugging set to Developer Mode . Here is my test string:

 <p>{mlang en}English{mlang}{mlang fr}French{mlang}</p>

When the filter code is executed, I end up with is the following PHP notice:

 Notice:  Undefined index: en in /moodle/filter/multilangsecond/filter.php on line 106.
 Notice:  Undefined index: fr in /moodle/filter/multilangsecond/filter.php on line 106

This is what is causing the error in line 106:

 $rawlanglist[$ri][$index]

When I do a var_dump($rawlanglist[1]) I see:

 array(2) {
   [0]=>string(2) "en"
   [1]=>string(2) "fr"
 }

As you can see, $rawlanglist is a single dimension array and none of the array indexes are named 'en' or 'fr'.

Hope this helps you figure out the solution.

Best regards,

Michael

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.