Changeset 1074 for trunk


Ignore:
Timestamp:
12/13/09 14:19:40 (2 years ago)
Author:
gcosmin
Message:

Standardize the use of commabelow "sh" versus cedille "sh" in textile pages

Solves ticket #379.
Review URL: http://reviewboard.infoarena.ro/r/107/

Script to change all special characters commabelow to cedille in all textblocks.
Modified add_textblock_revision to make this change automatically.

Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/common/common.php

    r1069 r1074  
    11<?php 
     2 
     3// Changes all special characters ș, ț, Ș, Ț to ş, ţ, Ş, Ţ 
     4// commabelow to cedille and returns the modified text 
     5// FIXME: reverse characters in to_change when windows XP dies 
     6function text_change_special_chars($text) { 
     7    $to_change = array("ș"=>"ş", "ț"=>"ţ", "Ș"=>"Ş", "Ț"=>"Ţ"); 
     8 
     9    foreach ($to_change as $bad=>$good) { 
     10        $text = mb_ereg_replace($bad, $good, $text); 
     11    } 
     12 
     13    return $text; 
     14} 
    215 
    316// Nicer way to get an element from an array. It returns a default value 
  • trunk/common/db/textblock.php

    r1057 r1074  
    66require_once(IA_ROOT_DIR."common/security.php"); 
    77require_once(IA_ROOT_DIR."common/textblock.php"); 
     8require_once(IA_ROOT_DIR."common/common.php"); 
    89 
    910// Textblock-related db functions. 
     
    1819        $remote_ip_info = null) { 
    1920    $name = normalize_page_name($name); 
     21 
     22    // Change special characters in content 
     23    $content = text_change_special_chars($content); 
     24 
    2025    $tb = array( 
    2126            'name' => $name, 
Note: See TracChangeset for help on using the changeset viewer.