You are here

function mathjax_update_7201 in MathJax: LaTeX for Drupal 7.2

Update the CDN URL.

File

./mathjax.install, line 95
MathJax module install.

Code

function mathjax_update_7201() {
  $url = variable_get('mathjax_cdn_url');
  $new = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js';
  $old = 'https://cdn.mathjax.org/mathjax/latest/MathJax.js';
  if (strpos($url, $old) !== FALSE) {
    $url = str_replace($old, $new, $url);
    variable_set('mathjax_cdn_url', $url);
  }
}