[geeklog-jp commit] r1095 - trunk/geeklog-1-jp/system/classes

Zurück zum Archiv-Index

codes****@googl***** codes****@googl*****
2009年 1月 8日 (木) 13:24:17 JST


Author: mystralkk
Date: Wed Jan  7 19:56:00 2009
New Revision: 1095

Modified:
    trunk/geeklog-1-jp/system/classes/story.class.php

Log:
r1075での対策を完全なものにするために、正規表現のデリミタを(|)に変え、正規表 
現を最適化しました。

Modified: trunk/geeklog-1-jp/system/classes/story.class.php
==============================================================================
--- trunk/geeklog-1-jp/system/classes/story.class.php	(original)
+++ trunk/geeklog-1-jp/system/classes/story.class.php	Wed Jan  7 19:56:00  
2009
@@ -1173,9 +1173,9 @@
                  $imgSrc =  
$_CONF['site_url'] . '/getimage.php?mode=articles&image=' .  
$A['ai_filename'];
              }

-            $norm = '/' . preg_quote($lLinkPrefix . '<img ' .  
$sizeattributes . 'src="' . $imgSrc . '" alt=""', '/') . '[ \/]*' .  
preg_quote('>' . $lLinkSuffix, '/') . '/';
-            $left = '/' . preg_quote($lLinkPrefix . '<img ' .  
$sizeattributes . 'class="floatleft" src="' . $imgSrc . '"  
alt=""', '/') . '[ \/]*' . preg_quote('>' . $lLinkSuffix, '/') . '/';
-            $right = '/' . preg_quote($lLinkPrefix . '<img ' .  
$sizeattributes . 'class="floatright" src="' . $imgSrc . '"  
alt=""', '/') . '[ \/]*' . preg_quote('>' . $lLinkSuffix, '/') . '/';
+            $norm = '|' . preg_quote($lLinkPrefix . '<img ' .  
$sizeattributes . 'src="' . $imgSrc . '" alt=""', '|') . '( /)?>' .  
preg_quote($lLinkSuffix, '|') . '|';
+            $left = '|' . preg_quote($lLinkPrefix . '<img ' .  
$sizeattributes . 'class="floatleft" src="' . $imgSrc . '"  
alt=""', '|') . '( /)?>' . preg_quote($lLinkSuffix, '|') . '|';
+            $right = '|' . preg_quote($lLinkPrefix . '<img ' .  
$sizeattributes . 'class="floatright" src="' . $imgSrc . '"  
alt=""', '|') . '( /)?>' . preg_quote($lLinkSuffix, '|') . '|';

              $text = preg_replace($norm, $imageX, $text);
              $text = preg_replace($left, $imageX_left, $text);
@@ -1188,9 +1188,9 @@

                  if (file_exists($lFilename_large_complete)) {
                      $sizeattributes =  
COM_getImgSizeAttributes($lFilename_large_complete);
-                    $norm = '/' . preg_quote('<img ' .  
$sizeattributes . 'src="' . $lFilename_large_URL . '" alt=""', '/') . '[  
\/]*' . preg_quote('>', '/') . '/';
-                    $left = '/' . preg_quote('<img ' .  
$sizeattributes . 'align="left" src="' . $lFilename_large_URL . '"  
alt=""', '/') . '[ \/]*' . preg_quote('>', '/') . '/';
-                    $right = '/' . preg_quote('<img ' .  
$sizeattributes . 'align="right" src="' . $lFilename_large_URL . '"  
alt=""', '/') . '[ \/]*' . preg_quote('>', '/') . '/';
+                    $norm = '|' . preg_quote('<img ' .  
$sizeattributes . 'src="' . $lFilename_large_URL . '" alt=""', '|') . '(  
/)?>|';
+                    $left = '|' . preg_quote('<img ' .  
$sizeattributes . 'align="left" src="' . $lFilename_large_URL . '"  
alt=""', '|') . '( /)?>|';
+                    $right = '|' . preg_quote('<img ' .  
$sizeattributes . 'align="right" src="' . $lFilename_large_URL . '"  
alt=""', '|') . '( /)?>|';
                  }

                  $text = preg_replace($norm, $unscaledX, $text);



Geeklogjp-changes メーリングリストの案内
Zurück zum Archiv-Index