Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php |
— | — | @@ -156,7 +156,7 @@ |
157 | 157 | // foreach ($outrel as $result) { |
158 | 158 | // $objectoptions = new SMWRequestOptions(); |
159 | 159 | // $objectoptions->limit = $innerlimit; |
160 | | -// $html .= '<strong>' . $skin->makeKnownLinkObj($result, preg_replace('/[\s]/', ' ', smwfT($result), 2)) . "</strong> \n";// TODO makeLinkObj or makeKnownLinkObj? |
| 160 | +// $html .= '<strong>' . $skin->makeKnownLinkObj($result, preg_replace('/[\s]/u', ' ', smwfT($result), 2)) . "</strong> \n";// TODO makeLinkObj or makeKnownLinkObj? |
161 | 161 | // $objects = &smwfGetStore()->getRelationObjects($article, $result, $objectoptions); |
162 | 162 | // $objectcount = count($objects); |
163 | 163 | // $count = 0; |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Linear.php |
— | — | @@ -171,7 +171,7 @@ |
172 | 172 | if (!$numdv->isValid() || ($numdv->getNumericValue() === 0)) { |
173 | 173 | continue; // ignore problmatic conversions |
174 | 174 | } |
175 | | - $unit_aliases = preg_split('/\s*,\s*/', $numdv->getUnit()); |
| 175 | + $unit_aliases = preg_split('/\s*,\s*/u', $numdv->getUnit()); |
176 | 176 | $first = true; |
177 | 177 | foreach ($unit_aliases as $unit) { |
178 | 178 | $unit = $this->normalizeUnit($unit); |
— | — | @@ -204,7 +204,7 @@ |
205 | 205 | $values = smwfGetStore()->getSpecialValues($proptitle, SMW_SP_DISPLAY_UNITS); |
206 | 206 | $units = array(); |
207 | 207 | foreach ($values as $value) { // Join all if many annotations exist. Discouraged (random order) but possible. |
208 | | - $units = $units + preg_split('/\s*,\s*/',$value->getXSDValue()); |
| 208 | + $units = $units + preg_split('/\s*,\s*/u',$value->getXSDValue()); |
209 | 209 | } |
210 | 210 | foreach ($units as $unit) { |
211 | 211 | $unit = $this->normalizeUnit($unit); |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValue.php |
— | — | @@ -101,7 +101,7 @@ |
102 | 102 | foreach ($servicelinks as $dvs) { |
103 | 103 | $args[0] = 'smw_service_' . str_replace(' ', '_', $dvs); // messages distinguish ' ' from '_' |
104 | 104 | $text = call_user_func_array('wfMsgForContent', $args); |
105 | | - $links = preg_split("([\n][\s]?)", $text); |
| 105 | + $links = preg_split("/[\n][\s]?/u", $text); |
106 | 106 | foreach ($links as $link) { |
107 | 107 | $linkdat = explode('|',$link,2); |
108 | 108 | if (count($linkdat) == 2) |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_GeoCoords.php |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | $value = str_replace(array('″', '″', "''", '"', '´´', SMW_GEO_MIN . SMW_GEO_MIN),SMW_GEO_SEC,$value); |
43 | 43 | $value = str_replace(array('′', '′', "'", '´'),SMW_GEO_MIN,$value); |
44 | 44 | // now split the string |
45 | | - $parts = preg_split('/\s*(°|' . SMW_GEO_MIN . '|' . SMW_GEO_SEC . '|N|E|W|S|;)\s*/',str_replace(', ', ';', $value) . ';', -1, PREG_SPLIT_DELIM_CAPTURE); |
| 45 | + $parts = preg_split('/\s*(°|' . SMW_GEO_MIN . '|' . SMW_GEO_SEC . '|N|E|W|S|;)\s*/u',str_replace(', ', ';', $value) . ';', -1, PREG_SPLIT_DELIM_CAPTURE); |
46 | 46 | $curnum = false; |
47 | 47 | $angles = array(false, false, false); // temporary values for deg, min, sec |
48 | 48 | foreach ($parts as $part) { |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Hooks.php |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | )*) # all this zero or more times |
45 | 45 | (\|([^]]*))? # Display text (like "text" in [[link|text]]), optional |
46 | 46 | \]\] # End of link |
47 | | - /x'; |
| 47 | + /xu'; |
48 | 48 | $text = preg_replace_callback($semanticLinkPattern, 'smwfParsePropertiesCallback', $text); |
49 | 49 | |
50 | 50 | SMWFactbox::printFactbox($text); |
— | — | @@ -85,7 +85,7 @@ |
86 | 86 | } else { $valueCaption = false; } |
87 | 87 | |
88 | 88 | //extract annotations and create tooltip |
89 | | - $properties = preg_split('/:[=:]/', $property); |
| 89 | + $properties = preg_split('/:[=:]/u', $property); |
90 | 90 | foreach($properties as $singleprop) { |
91 | 91 | $dv = SMWFactbox::addProperty($singleprop,$value,$valueCaption, $smwgStoreAnnotations && $smwgTempStoreAnnotations); |
92 | 92 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Factbox.php |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | global $wgContLang; |
115 | 115 | |
116 | 116 | list($onto_ns,$onto_section) = explode(':',$value,2); |
117 | | - $msglines = preg_split("([\n][\s]?)",wfMsgForContent("smw_import_$onto_ns")); // get the definition for "$namespace:$section" |
| 117 | + $msglines = preg_split("/[\n][\s]?/u",wfMsgForContent("smw_import_$onto_ns")); // get the definition for "$namespace:$section" |
118 | 118 | |
119 | 119 | if ( count($msglines) < 2 ) { //error: no elements for this namespace |
120 | 120 | /// TODO: use new Error DV |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_URI.php |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | $value = 'http://' . $value; |
51 | 51 | $parts[1] = $parts[0]; |
52 | 52 | $parts[0] = 'http'; |
53 | | - } elseif ( (count($parts) < 1) || ($parts[0] == '') || ($parts[1] == '') || (preg_match('/[^a-zA-Z]/',$parts[0]) )) { |
| 53 | + } elseif ( (count($parts) < 1) || ($parts[0] == '') || ($parts[1] == '') || (preg_match('/[^a-zA-Z]/u',$parts[0]) )) { |
54 | 54 | $this->addError(wfMsgForContent('smw_baduri', $value)); |
55 | 55 | return true; |
56 | 56 | } |
— | — | @@ -63,7 +63,7 @@ |
64 | 64 | } |
65 | 65 | } |
66 | 66 | // simple check for invalid characters: ' ', '{', '}' |
67 | | -// $check1 = "@(\}|\{| )+@"; |
| 67 | +// $check1 = "@(\}|\{| )+@u"; |
68 | 68 | // if (preg_match($check1, $value, $matches)) { |
69 | 69 | // $this->addError(wfMsgForContent('smw_baduri', $value)); |
70 | 70 | // break; |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | /// TODO: the remaining checks need improvement |
73 | 73 | // // validate last part of URI (after #) if provided |
74 | 74 | // $uri_ex = explode('#',$value); |
75 | | -// $check2 = "@^[a-zA-Z0-9-_\%]+$@"; ///FIXME: why only ascii symbols? |
| 75 | +// $check2 = "@^[a-zA-Z0-9-_\%]+$@u"; ///FIXME: why only ascii symbols? |
76 | 76 | // if(sizeof($uri_ex)>2 ){ // URI should only contain at most one '#' |
77 | 77 | // $this->addError(wfMsgForContent('smw_baduri', $value) . 'Debug3'); |
78 | 78 | // break; |
— | — | @@ -103,7 +103,7 @@ |
104 | 104 | } |
105 | 105 | break; |
106 | 106 | case SMW_URI_MODE_EMAIL: |
107 | | - $check = "#^([_a-zA-Z0-9-]+)((\.[_a-zA-Z0-9-]+)*)@([_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*)\.([a-zA-Z]{2,3})$#"; |
| 107 | + $check = "#^([_a-zA-Z0-9-]+)((\.[_a-zA-Z0-9-]+)*)@([_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*)\.([a-zA-Z]{2,3})$#u"; |
108 | 108 | if (!preg_match($check, $value)) { |
109 | 109 | ///TODO: introduce error-message for "bad" email |
110 | 110 | $this->addError(wfMsgForContent('smw_baduri', $value)); |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php |
— | — | @@ -723,7 +723,7 @@ |
724 | 724 | if ($value == '*') { // printout statement |
725 | 725 | return; |
726 | 726 | } |
727 | | - $list = preg_split('/^(' . $smwgQComparators . ')/',$value, 2, PREG_SPLIT_DELIM_CAPTURE); |
| 727 | + $list = preg_split('/^(' . $smwgQComparators . ')/u',$value, 2, PREG_SPLIT_DELIM_CAPTURE); |
728 | 728 | $comparator = SMW_CMP_EQ; |
729 | 729 | if (count($list) == 3) { // initial comparator found ($list[1] should be empty) |
730 | 730 | switch ($list[1]) { |
— | — | @@ -855,7 +855,7 @@ |
856 | 856 | if ($stoppattern == '') { |
857 | 857 | $stoppattern = '\[\[|\]\]|::|:=|<q>|<\/q>|^' . $this->m_categoryprefix . '|\|\||\|'; |
858 | 858 | } |
859 | | - $chunks = preg_split('/[\s]*(' . $stoppattern . ')[\s]*/', $this->m_curstring, 2, PREG_SPLIT_DELIM_CAPTURE); |
| 859 | + $chunks = preg_split('/[\s]*(' . $stoppattern . ')[\s]*/u', $this->m_curstring, 2, PREG_SPLIT_DELIM_CAPTURE); |
860 | 860 | if (count($chunks) == 1) { // no matches anymore, strip spaces and finish |
861 | 861 | if ($consume) { |
862 | 862 | $this->m_curstring = ''; |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QP_Timeline.php |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | } |
38 | 38 | if (array_key_exists('timelinebands', $params)) { |
39 | 39 | //check for band parameter, should look like "DAY,MONTH,YEAR" |
40 | | - $this->m_tlbands = preg_split('/[,][\s]*/',trim($params['timelinebands'])); |
| 40 | + $this->m_tlbands = preg_split('/[,][\s]*/u',trim($params['timelinebands'])); |
41 | 41 | } else { |
42 | 42 | $this->m_tlbands = array('MONTH','YEAR'); /// TODO: check what default the JavaScript uses |
43 | 43 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Infolink.php |
— | — | @@ -103,7 +103,7 @@ |
104 | 104 | $end = ''; |
105 | 105 | } |
106 | 106 | if ($this->internal) { |
107 | | - if (preg_match('/(.*)(\[|\]|<|>|>|<|\'\'|{|})(.*)/', $this->target) != 0 ) { |
| 107 | + if (preg_match('/(.*)(\[|\]|<|>|>|<|\'\'|{|})(.*)/u', $this->target) != 0 ) { |
108 | 108 | return ''; // give up if illegal characters occur, |
109 | 109 | // TODO: we would need a skin to provide an ext URL in this case |
110 | 110 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Number.php |
— | — | @@ -42,12 +42,12 @@ |
43 | 43 | $kiloseparator = wfMsgForContent('smw_kiloseparator'); |
44 | 44 | |
45 | 45 | $parts = preg_split('/([-+]?\s*\d+(?:\\' . $kiloseparator . '\d\d\d)*' . |
46 | | - '(?:\\' . $decseparator . '\d+)?\s*(?:[eE][-+]?\d+)?)/', |
| 46 | + '(?:\\' . $decseparator . '\d+)?\s*(?:[eE][-+]?\d+)?)/u', |
47 | 47 | trim(str_replace(array(' ',' '), '', $value)), |
48 | 48 | 2, PREG_SPLIT_DELIM_CAPTURE); |
49 | 49 | |
50 | 50 | if (count($parts) >= 2) { |
51 | | - $numstring = str_replace($kiloseparator, '', preg_replace('/\s*/', '', $parts[1])); // simplify |
| 51 | + $numstring = str_replace($kiloseparator, '', preg_replace('/\s*/u', '', $parts[1])); // simplify |
52 | 52 | if ($decseparator != '.') { |
53 | 53 | $numstring = str_replace($decseparator, '.', $numstring); |
54 | 54 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php |
— | — | @@ -547,7 +547,7 @@ |
548 | 548 | // Should we use decimal places here? |
549 | 549 | $value = sprintf("%1.6e", $value); |
550 | 550 | // Make it more readable by removing trailing zeroes from n.n00e7. |
551 | | - $value = preg_replace('/(\\.\\d+?)0*e/', '${1}e', $value, 1); |
| 551 | + $value = preg_replace('/(\\.\\d+?)0*e/u', '${1}e', $value, 1); |
552 | 552 | //NOTE: do not use the optional $count parameter with preg_replace. We need to |
553 | 553 | // remain compatible with PHP 4.something. |
554 | 554 | if ($decseparator !== '.') { |
— | — | @@ -567,7 +567,7 @@ |
568 | 568 | } else { |
569 | 569 | // If above replacement occurred, no need to do the next one. |
570 | 570 | // Make it more readable by removing trailing zeroes from nn.n00. |
571 | | - $value = preg_replace("/(\\$decseparator\\d+?)0*$/", '$1', $value, 1); |
| 571 | + $value = preg_replace("/(\\$decseparator\\d+?)0*$/u", '$1', $value, 1); |
572 | 572 | } |
573 | 573 | } |
574 | 574 | return $value; |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_NAry.php |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | } |
45 | 45 | |
46 | 46 | $types = $this->m_type->getTypeValues(); |
47 | | - $values = preg_split('/[\s]*;[\s]*/', trim($value), $this->m_count); |
| 47 | + $values = preg_split('/[\s]*;[\s]*/u', trim($value), $this->m_count); |
48 | 48 | $vi = 0; // index in value array |
49 | 49 | $empty = true; |
50 | 50 | for ($i = 0; $i < $this->m_count; $i++) { // iterate over slots |