make it easier to recognize http:// or https:// urls as external ones in CMO
authorZbigniew Braniecki (zbraniecki@mozilla.com)
Tue, 30 Sep 2008 14:29:43 -0700
changeset 11 78d95736b1d081f06778d10150fc1778cba2e890
parent 10 992ee5d2ac5fcc1d50594453f886b74840cd6f15
child 12 1b4cb3e4fd9a67f8fa2b827602dbe7b534ef0805
push id2
push userroot
push dateWed, 01 Oct 2008 07:05:37 +0000
make it easier to recognize http:// or https:// urls as external ones in CMO
mediawiki/extensions/cmo.php
--- a/mediawiki/extensions/cmo.php
+++ b/mediawiki/extensions/cmo.php
@@ -39,17 +39,17 @@ function CMOBox( $input, $argv, &$parser
 
 // start the rendering the html output
   $output = '<div class="topicbox" '.$style.'><h2>'.$parser->recursiveTagParse((string)$argv['title']).'</h2><table>';
   $i = 0;
   
   foreach ($xml->cmocell as $cmocell) {
 	if ($i==0)
 	  $output .= '<tr>';
-    if (strpos((string)$cmocell['url'], 'http://')===false) {
+    if (substr($cmocell['url'],0,7)!='http://' &&  substr($cmocell['url'],0,8)!='https://') {
       $title = Title::newFromText((string)$cmocell['url']);
       if ($title)
         $url = $title->getLocalURL();
     } else {
       if ($cmocell['url'])
         $url = (string)$cmocell['url'];
     }
     if ($url) {