r31787 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r31786‎ | r31787 | r31788 >
Date:15:28, 11 March 2008
Author:mkroetzsch
Status:old
Tags:
Comment:
Added quickfixes as suggested for Bug 13321
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Factbox.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php
@@ -141,8 +141,8 @@
142142 // replace the last two whitespaces in the relation name with
143143 // non-breaking spaces. Since there seems to be no PHP-replacer
144144 // for the last two, a strrev ist done twice to turn it around.
145 - // That's why nbsp is written backward.
146 - $html .= ' &nbsp;<strong>' . $skin->makeKnownLinkObj($result, strrev(preg_replace('/[\s]/', ';psbn&', strrev(smwfT($result)), 2) )) . '</strong>' . $vsep . "\n"; // TODO makeLinkObj or makeKnownLinkObj?
 145+ // That's why nbsp is written backwards.
 146+ $html .= ' &nbsp;<strong>' . $skin->makeKnownLinkObj($result, strrev(preg_replace('/[\s]/u', ';psbn&', strrev(smwfT($result)), 2) )) . '</strong>' . $vsep . "\n"; // TODO makeLinkObj or makeKnownLinkObj?
147147 }
148148 if (($offset>0) || (count($inprop)>$limit)) $html .= $navigation;
149149 }
@@ -175,7 +175,7 @@
176176 // }
177177 foreach ($atts as $att) {
178178 $objectoptions = new SMWRequestOptions();
179 - $html .= '<strong>' . $skin->makeKnownLinkObj($att, preg_replace('/[\s]/', '&nbsp;', smwfT($att), 2)) . "</strong>&nbsp; \n";
 179+ $html .= '<strong>' . $skin->makeKnownLinkObj($att, preg_replace('/[\s]/u', '&nbsp;', smwfT($att), 2)) . "</strong>&nbsp; \n";
180180 $objects = &smwfGetStore()->getPropertyValues($article->getTitle(), $att, $objectoptions);
181181 $objectcount = count($objects);
182182 $count = 0;
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Factbox.php
@@ -270,7 +270,7 @@
271271 foreach(SMWFactbox::$semdata->getProperties() as $key => $property) {
272272 $text .= '<tr><td class="smwpropname">';
273273 if ($property instanceof Title) {
274 - $text .= '<tr><td class="smwpropname">[[' . $property->getPrefixedText() . '|' . preg_replace('/[\s]/','&nbsp;',$property->getText(),2) . ']] </td><td class="smwprops">';
 274+ $text .= '<tr><td class="smwpropname">[[' . $property->getPrefixedText() . '|' . preg_replace('/[ ]/u','&nbsp;',$property->getText(),2) . ']] </td><td class="smwprops">';
275275 // TODO: the preg_replace is a kind of hack to ensure that the left column does not get too narrow; maybe we can find something nicer later
276276 } else { // special property
277277 if ($key{0} == '_') continue; // internal special property without label

Follow-up revisions

RevisionCommit summaryAuthorDate
r31804Protect all preg_* against UTF8 hassles using /u, see Bug 13321.mkroetzsch17:56, 11 March 2008

Status & tagging log