------------------------------------------------------------
revno: 865
committer: Roger Martin <[email protected]>
branch nick: aikiframework
timestamp: Wed 2011-06-22 22:18:28 +0200
message:
  regular expression in display/kill urls
modified:
  src/libs/url.php
  src/libs/widgets.php


--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk

Your team Aiki Framework Developers is subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to 
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== modified file 'src/libs/url.php'
--- src/libs/url.php	2011-06-21 21:47:15 +0000
+++ src/libs/url.php	2011-06-22 20:18:28 +0000
@@ -124,8 +124,12 @@
 					return true;
 				} elseif ( strpos( $displayUrl, "*")!==false){
 					// now the hard work user/details/1 must match user/details/*	
-				    $temp= str_replace("*","[^/]*", $displayUrl );
-				    return preg_match ( "#^". $temp. '$#ui', $this->pretty);
+					if ( preg_match ('/^#.+#[Uims]*$/', $displayUrl)) {						
+						return preg_match ( $displayUrl, $this->pretty);
+					} else {						
+						$temp= str_replace("*","[^/]*", $displayUrl );					
+						return preg_match ( "#^". $temp. '$#ui', $this->pretty);
+					}				    
 				}				
 			}	
 		}	

=== modified file 'src/libs/widgets.php'
--- src/libs/widgets.php	2011-06-22 05:41:35 +0000
+++ src/libs/widgets.php	2011-06-22 20:18:28 +0000
@@ -1079,13 +1079,10 @@
 		$SQL =
 			"SELECT id, display_urls,kill_urls,widget_name ".
 			" FROM aiki_widgets ".
-			" WHERE father_widget=$father and is_active=1 and ".
-			" (widget_site='$site' or widget_site ='aiki_shared' or widget_site ='default') and ".
-			" (display_urls LIKE '%$search%' OR display_urls = '*' )" .
-			   // until display_urls and kill_urls don't have | as separator
-			   // this don't work
-			   // display_urls LIKE '%|$search/%') AND ".
-			   //" kill_urls <> '|$search|'" .   
+			" WHERE father_widget=$father AND is_active=1 AND ".
+			" (widget_site='$site' OR widget_site ='aiki_shared' OR widget_site ='default') AND ".
+			" (display_urls LIKE '%$search%' OR display_urls = '*' OR display_urls LIKE '%#%#%') AND ".
+			" (kill_urls='' OR kill_urls<> '$search') ".	
 			" ORDER BY  display_order, id";
          return $db->get_results($SQL);
 	}	

_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help   : https://help.launchpad.net/ListHelp

Reply via email to