Ticket #12912: mwutf8.diff

File mwutf8.diff, 1.9 KB (added by yiannividalis@…, 7 years ago)

unicode categories in mythweb

  • includes/css.php

    diff --git a/includes/css.php b/includes/css.php
    index 4419bac..0745b4e 100644
    a b  
    2525        $css_class[] = recstatus_class($item);
    2626    // Category type?
    2727        if ($item->category_type && !preg_match('/unknown/i', $item->category_type))
    28             $css_class[] = 'type_'.preg_replace("/[^a-zA-Z0-9\-_]+/", '_', $item->category_type);
     28            $css_class[] = 'type_'.preg_replace("/[^a-zA-Z0-9\-_]+/u", '_', $item->category_type);
    2929    // Category cache
    3030        $category = strtolower($item->category);    // user lowercase to avoid a little overhead later
    3131        static $cache = array();
     
    4242                    }
    4343                    if (!$details[1])
    4444                        continue;
    45                     if (preg_match('/'.$details[1].'/', $category)) {
     45                    if (preg_match('/'.$details[1].'/u', $category)) {
    4646                        $css_class[] = $cache[$category] = 'cat_'.$cat;
    4747                        break;
    4848                    }
  • modules/tv/handler.php

    diff --git a/modules/tv/handler.php b/modules/tv/handler.php
    index 66285b6..c048c6c 100644
    a b  
    9393            trigger_error("Failed to open tv category file:  $path", FATAL);
    9494    // Parse the file
    9595        global $Categories;
    96         foreach (preg_split('/\n(?=\S)/', $file) as $group) {
    97             list($key, $trans, $regex) = preg_split('/\s*\n\s*/', $group);
     96        foreach (preg_split('/\n(?=\S)/u', $file) as $group) {
     97            list($key, $trans, $regex) = preg_split('/\s*\n\s*/u', $group);
    9898        // Cleanup
    99             if (preg_match('/^["\']/', $key))
    100                 $key = preg_replace('/^(["\'])(.+)\\1$/', '$2', $key);
     99            if (preg_match('/^["\']/u', $key))
     100                $key = preg_replace('/^(["\'])(.+)\\1$/u', '$2', $key);
    101101        // Store
    102102            $Categories[$key] = array($trans, $regex);
    103103        }